From b9e332b3b1df4419e41f079f660590392cf36867 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 29 Feb 2024 19:59:00 +0000 Subject: [PATCH] Cleanup large unused files Reduces the alpine image from 46M to 41M. yajl parts can be removed if/when https://github.com/brianmario/yajl-ruby/pull/228 is merged and released. Signed-off-by: Orgad Shaneh --- Dockerfile.template.erb | 10 +++++++++- v1.16/alpine/Dockerfile | 10 +++++++++- v1.16/arm64/debian/Dockerfile | 10 +++++++++- v1.16/armhf/debian/Dockerfile | 10 +++++++++- v1.16/debian/Dockerfile | 10 +++++++++- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Dockerfile.template.erb b/Dockerfile.template.erb index 5ac99841..e1916559 100644 --- a/Dockerfile.template.erb +++ b/Dockerfile.template.erb @@ -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 \ diff --git a/v1.16/alpine/Dockerfile b/v1.16/alpine/Dockerfile index 75e65f4b..5a17d7b4 100644 --- a/v1.16/alpine/Dockerfile +++ b/v1.16/alpine/Dockerfile @@ -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) diff --git a/v1.16/arm64/debian/Dockerfile b/v1.16/arm64/debian/Dockerfile index 2522dd6b..3cdcbd76 100644 --- a/v1.16/arm64/debian/Dockerfile +++ b/v1.16/arm64/debian/Dockerfile @@ -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) diff --git a/v1.16/armhf/debian/Dockerfile b/v1.16/armhf/debian/Dockerfile index e9e8860e..54e2cab7 100644 --- a/v1.16/armhf/debian/Dockerfile +++ b/v1.16/armhf/debian/Dockerfile @@ -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) diff --git a/v1.16/debian/Dockerfile b/v1.16/debian/Dockerfile index d893e371..01a81a09 100644 --- a/v1.16/debian/Dockerfile +++ b/v1.16/debian/Dockerfile @@ -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)