From 2cf9bd62af26a3262b8656a174a384964c78f974 Mon Sep 17 00:00:00 2001 From: Jake Jarvis Date: Sun, 14 Mar 2021 11:28:44 -0400 Subject: [PATCH] clone source from Git repo instead of downloading from GitHub release --- Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 959cd2e..60e11a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,12 +25,21 @@ RUN apk update && \ apk add --no-cache \ gcc \ g++ \ - musl-dev && \ + musl-dev \ + git && \ go get github.com/magefile/mage -RUN wget https://github.com/gohugoio/hugo/archive/v${HUGO_VERSION}.tar.gz && \ - tar xf v${HUGO_VERSION}.tar.gz --strip-components=1 && \ - rm v${HUGO_VERSION}.tar.gz +# clone source from Git repo: +RUN git clone \ + --branch "v${HUGO_VERSION}" \ + --single-branch \ + --depth 1 \ + https://github.com/gohugoio/hugo.git ./ + +# download source from GitHub release (old method): +# RUN wget https://github.com/gohugoio/hugo/archive/v${HUGO_VERSION}.tar.gz && \ +# tar xf v${HUGO_VERSION}.tar.gz --strip-components=1 && \ +# rm v${HUGO_VERSION}.tar.gz RUN mage -v hugo && mage install