Skip to content

Commit

Permalink
Merge pull request #375 from orgads/reduce-size
Browse files Browse the repository at this point in the history
Cleanup large unused files
  • Loading branch information
kenhys authored Sep 10, 2024
2 parents 5fb50cd + b63b5bb commit b08a74d
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Dockerfile.template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ RUN apt-get update \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v <%= fluentd_ver %> \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
&& find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
<% if is_alpine %>
&& gem install bigdecimal -v 1.4.4 \
&& apk del .build-deps \
Expand All @@ -146,7 +151,7 @@ RUN apt-get update \
'*-dev' \
&& rm -rf /var/lib/apt/lists/* \
<% end %>
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
&& rm -rf /tmp/* /var/tmp/*

<% if is_alpine %>
RUN addgroup -S fluent && adduser -S -G fluent fluent \
Expand Down
7 changes: 6 additions & 1 deletion v1.17/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ RUN apk update \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.17.1 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
&& find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& gem install bigdecimal -v 1.4.4 \
&& apk del .build-deps \
&& rm -rf /var/cache/apk/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
&& rm -rf /tmp/* /var/tmp/*

RUN addgroup -S fluent && adduser -S -G fluent fluent \
# for log storage (maybe shared with host)
Expand Down
7 changes: 6 additions & 1 deletion v1.17/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ RUN apt-get update \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.17.1 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
&& find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch" \
&& wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc" \
Expand All @@ -55,7 +60,7 @@ RUN apt-get update \
$buildDeps \
'*-dev' \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
&& rm -rf /tmp/* /var/tmp/*

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
7 changes: 6 additions & 1 deletion v1.17/armhf/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ RUN apt-get update \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.17.1 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
&& find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch" \
&& wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc" \
Expand All @@ -55,7 +60,7 @@ RUN apt-get update \
$buildDeps \
'*-dev' \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
&& rm -rf /tmp/* /var/tmp/*

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
7 changes: 6 additions & 1 deletion v1.17/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ RUN apt-get update \
&& gem install async -v 1.32.1 \
&& gem install async-http -v 0.64.2 \
&& gem install fluentd -v 1.17.1 \
&& export GEM_DIR=$(ruby -e 'puts Gem.dir') \
&& echo GEM_DIR=$GEM_DIR \
&& rm -rf $GEM_DIR/cache/*.gem \
&& find $GEM_DIR -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf \
&& find $GEM_DIR -name "*.so" | xargs -r strip \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch" \
&& wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc" \
Expand All @@ -44,7 +49,7 @@ RUN apt-get update \
$buildDeps \
'*-dev' \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/3.*/gems/fluentd-*/test
&& rm -rf /tmp/* /var/tmp/*

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down

0 comments on commit b08a74d

Please sign in to comment.