From 250e9f710d8a80b86b1fa415e2c10e7df41a77e1 Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 14 Jan 2021 01:30:21 +0100 Subject: [PATCH] feat: rm redundancies and refactor * only autoremove once - right before cleaning all dnf caches * move the dir cleanup to the place where related file handling occurs * for all this, add a separate RUN instruction --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index eec3007..d81beca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,15 +15,15 @@ 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 /tmp/hugo.tar.gz WORKDIR /tmp/ -RUN dnf --refresh upgrade -y && dnf install -y git findutils && dnf autoremove -y +RUN dnf --refresh upgrade -y && dnf install -y git findutils RUN tar xfv /tmp/hugo.tar.gz && rm -v /tmp/hugo.tar.gz README.md LICENSE \ && chmod +x /tmp/hugo \ && mkdir -pv /usr/local/bin \ - && mv -v /tmp/hugo /usr/local/bin/ -RUN dnf clean all -y \ - && rm -rv /usr/share/zoneinfo/* ; rm -rv /usr/include/* ; \ + && mv -v /tmp/hugo /usr/local/bin/ \ + && rm -rv /tmp/* +RUN dnf autoremove -y -x findutils \ + && dnf clean all -y +RUN rm -rv /usr/share/zoneinfo/* ; rm -rv /usr/include/* ; \ find /. -name "*~" -type f -delete; \ - find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete; \ - rm -rv /tmp/* ; \ - dnf autoremove -y -x findutils; dnf clean all -y || true + find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete WORKDIR /