Skip to content

Commit

Permalink
Cleanup large unused files
Browse files Browse the repository at this point in the history
Reduces the alpine image from 46M to 41M.

yajl parts can be removed if/when
brianmario/yajl-ruby#228 is merged and
released.

Signed-off-by: Orgad Shaneh <orgad.shaneh@audiocodes.com>
  • Loading branch information
orgads committed Sep 5, 2024
1 parent 5fb50cd commit 11f6b49
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
9 changes: 8 additions & 1 deletion Dockerfile.template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,14 @@ 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 %>
/usr/lib/ruby/gems/*/cache/*.gem \
&& find /usr/lib/ruby/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf
<% else %>
/usr/local/lib/ruby/gems/3.*/cache/*.gem \
&& find /usr/local/bundle/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf
<% end %>

<% if is_alpine %>
RUN addgroup -S fluent && adduser -S -G fluent fluent \
Expand Down
4 changes: 3 additions & 1 deletion v1.17/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ RUN apk update \
&& 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/* \
/usr/lib/ruby/gems/*/cache/*.gem \
&& find /usr/lib/ruby/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf

RUN addgroup -S fluent && adduser -S -G fluent fluent \
# for log storage (maybe shared with host)
Expand Down
4 changes: 3 additions & 1 deletion v1.17/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ 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/* \
/usr/local/lib/ruby/gems/3.*/cache/*.gem \
&& find /usr/local/bundle/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
4 changes: 3 additions & 1 deletion v1.17/armhf/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ 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/* \
/usr/local/lib/ruby/gems/3.*/cache/*.gem \
&& find /usr/local/bundle/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
4 changes: 3 additions & 1 deletion v1.17/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ 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/* \
/usr/local/lib/ruby/gems/3.*/cache/*.gem \
&& find /usr/local/bundle/gems -type d -name test -or -name ext -or -name spec -or -name benchmark | xargs -r rm -rf

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

0 comments on commit 11f6b49

Please sign in to comment.