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 <[email protected]>
  • Loading branch information
orgads committed Feb 29, 2024
1 parent 9ec0970 commit b9e332b
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 5 deletions.
10 changes: 9 additions & 1 deletion Dockerfile.template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,15 @@ 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/* \
/usr/lib/ruby/gems/*/cache/*.gem \
/usr/lib/ruby/gems/3.*/gems/fluentd-*/test \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/benchmark \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/ext \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/spec \
/usr/lib/ruby/gems/3.*/gems/oj-*/ext

<% if is_alpine %>
RUN addgroup -S fluent && adduser -S -G fluent fluent \
Expand Down
10 changes: 9 additions & 1 deletion v1.16/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ 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 \
/usr/lib/ruby/gems/3.*/gems/fluentd-*/test \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/benchmark \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/ext \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/spec \
/usr/lib/ruby/gems/3.*/gems/oj-*/ext

RUN addgroup -S fluent && adduser -S -G fluent fluent \
# for log storage (maybe shared with host)
Expand Down
10 changes: 9 additions & 1 deletion v1.16/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ 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/lib/ruby/gems/*/cache/*.gem \
/usr/lib/ruby/gems/3.*/gems/fluentd-*/test \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/benchmark \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/ext \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/spec \
/usr/lib/ruby/gems/3.*/gems/oj-*/ext

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
10 changes: 9 additions & 1 deletion v1.16/armhf/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,15 @@ 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/lib/ruby/gems/*/cache/*.gem \
/usr/lib/ruby/gems/3.*/gems/fluentd-*/test \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/benchmark \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/ext \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/spec \
/usr/lib/ruby/gems/3.*/gems/oj-*/ext

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
Expand Down
10 changes: 9 additions & 1 deletion v1.16/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ 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/lib/ruby/gems/*/cache/*.gem \
/usr/lib/ruby/gems/3.*/gems/fluentd-*/test \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/benchmark \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/ext \
/usr/lib/ruby/gems/3.*/gems/yajl-ruby-*/spec \
/usr/lib/ruby/gems/3.*/gems/oj-*/ext

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

0 comments on commit b9e332b

Please sign in to comment.