Skip to content

Commit

Permalink
use ARG instead of ENV to silence apt commands
Browse files Browse the repository at this point in the history
  • Loading branch information
skaes committed Feb 9, 2024
1 parent d3c1f0f commit 76a9951
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/fpm/fry/docker_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def dockerfile
if options[:update]
update = 'apt-get update && '
end
df[:dependencies] << "ENV DEBIAN_FRONTEND=noninteractive"
df[:dependencies] << "ARG DEBIAN_FRONTEND=noninteractive"
df[:dependencies] << "RUN #{update}apt-get install --yes #{Shellwords.join(build_dependencies)}"
when 'redhat'
df[:dependencies] << "RUN yum -y install #{Shellwords.join(build_dependencies)}"
Expand Down
8 changes: 4 additions & 4 deletions spec/docker_file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def self.included(base)
expect(subject.dockerfile).to eq(<<SHELL)
FROM <base>
WORKDIR /tmp/build
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install --yes arg blub foo
COPY .build.sh /tmp/build/
CMD /tmp/build/.build.sh
Expand Down Expand Up @@ -151,7 +151,7 @@ def self.included(base)
expect(subject.dockerfile).to eq(<<SHELL)
FROM <base>
WORKDIR /tmp/build
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install --yes D a b e\\=1.0.0
COPY .build.sh /tmp/build/
CMD /tmp/build/.build.sh
Expand All @@ -176,7 +176,7 @@ def self.included(base)
expect(subject.dockerfile).to eq(<<SHELL)
FROM <base>
WORKDIR /tmp/build
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install --yes a
COPY .build.sh /tmp/build/
CMD /tmp/build/.build.sh
Expand Down Expand Up @@ -239,7 +239,7 @@ def self.included(base)
FROM <base>
WORKDIR /tmp/build
probe a
ENV DEBIAN_FRONTEND=noninteractive
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get install --yes a
probe b
COPY .build.sh /tmp/build/
Expand Down

0 comments on commit 76a9951

Please sign in to comment.