From 878d71070cb4e1389b821bb0c15797d66a135509 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 22 Apr 2020 17:34:04 +0200 Subject: [PATCH] further minify the img by removing cache and docs --- Dockerfile | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b5d08df..f5ede0f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,10 +14,22 @@ LABEL org.label-schema.build-date=$BUILD_DATE \ ADD https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz ./hugo.tar.gz - -RUN pacman -Sy --noconfirm --needed git \ - && pacman -Scc \ - && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* - +WORKDIR /tmp/ RUN bsdtar xfv hugo.tar.gz && rm -v hugo.tar.gz README.md LICENSE \ && mv -v hugo /usr/local/bin/ + +RUN pacman -Sy --noconfirm --needed git && pacman --noconfirm -R $(pacman -Qdtq) +RUN pacman --noconfirm -Runs \ + gzip less sysfsutils which \ + && pacman --noconfirm -Runs tar gawk || true \ + && pacman -Scc && rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* + && rm -rv /usr/share/info/* \ + && rm -rv /usr/share/man/* \ + && rm -rv /usr/share/doc/* \ + && rm -rv /usr/share/zoneinfo/* \ + && rm -rv /usr/share/i18n/* \ + && find /. -name "*~" -type f -delete \ + && find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete \ + && rm -rv /tmp/* \ + && rm -rv /usr/include/* +WORKDIR /