From a478b7e689e3b062665d50040c34ab569e539a33 Mon Sep 17 00:00:00 2001 From: surtur Date: Thu, 24 Mar 2022 17:08:23 +0100 Subject: [PATCH] refactor(dockerfile): consolidate consecutive RUNs .. to achieve faster builds --- Dockerfile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1688251..d4da3bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,15 +15,18 @@ 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 pacman -Syu --noconfirm --needed git -RUN pacman --noconfirm -Rn "$(pacman -Qdtq)" || true -RUN bsdtar 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 pacman -Scc && rm -rf /var/cache/pacman/* /var/lib/pacman/sync/* \ - && rm -rf /usr/share/zoneinfo/* ; \ - rm -rf /usr/share/i18n/* ;rm -rf /usr/include/* ; \ - find /. -name "*~" -type f -delete; \ - find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete +RUN pacman -Syu --noconfirm --needed git && \ + pacman --noconfirm -Rn "$(pacman -Qdtq)" || true && \ + \ + bsdtar 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/ && \ + \ + pacman -Scc && rm -rf /var/cache/pacman/* /var/lib/pacman/sync/* && \ + rm -rf /usr/share/zoneinfo/*; \ + rm -rf /usr/share/i18n/*; \ + rm -rf /usr/include/*; \ + find /. -name "*~" -type f -delete; \ + find /usr/share/terminfo/. ! -name "*xterm*" ! -name "*screen*" ! -name "*screen*" -type f -delete WORKDIR /