From 39ae123f516e18eb32ea1f17c9d04ddbe718d385 Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 1 Jun 2025 21:55:00 +0200 Subject: [PATCH] fix: extract Hugo binary to temp directory before moving to final location --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0abc179..85ddef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,10 @@ RUN LATEST_RELEASE=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases VERSION=${LATEST_RELEASE#v} && \ echo "Installing latest Hugo version: $VERSION" && \ wget https://github.com/gohugoio/hugo/releases/download/${LATEST_RELEASE}/hugo_extended_${VERSION}_linux-amd64.tar.gz -O hugo.tar.gz && \ - tar -xzf hugo.tar.gz -C /usr/local/bin/ && \ - rm hugo.tar.gz && \ + mkdir -p /tmp/hugo && \ + tar -xzf hugo.tar.gz -C /tmp/hugo && \ + mv /tmp/hugo/hugo /usr/local/bin/ && \ + rm -rf /tmp/hugo hugo.tar.gz && \ chmod +x /usr/local/bin/hugo && \ hugo version