Skip to content

Commit

Permalink
reduce v1.16 image size 235 vs 611MB
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <[email protected]>
  • Loading branch information
pepov committed Oct 9, 2023
1 parent 83fd803 commit f79bf95
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions v1.16/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ENV FLUENTD_VERSION 1.16.2

LABEL Description="Fluentd docker image" Vendor="Kube logging" Version="${FLUENTD_VERSION}"

ADD ./Gemfile /Gemfile

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apk delete' has no effect
Expand All @@ -24,10 +26,9 @@ RUN apk update \
build-base \
ruby-dev gnupg \
&& apk add $buildDeps \
&& echo 'gem: --no-document' >> /etc/gemrc
ADD ./Gemfile /Gemfile
RUN gem install bundler && bundle install
RUN apk del .build-deps $buildDeps \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install bundler && bundle install \
&& apk del .build-deps $buildDeps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test

RUN addgroup -S fluent && adduser -S -G fluent fluent \
Expand Down

0 comments on commit f79bf95

Please sign in to comment.