feat: rm redundancies and refactor
All checks were successful
continuous-integration/drone/push Build is passing

* 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
This commit is contained in:
surtur 2021-01-14 01:30:21 +01:00
parent bd25834bb9
commit 250e9f710d
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

@ -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 /