Files
docker-hugo/Dockerfile
paspo 675d249067
Some checks failed
Container Publish / on-success-skip (push) Has been skipped
Container Publish / build-image (arm64) (push) Failing after 11s
Container Publish / build-image (amd64) (push) Failing after 16s
Container Publish / update docker manifest (push) Has been skipped
fix github url
2025-12-11 16:25:17 +01:00

27 lines
881 B
Docker

##### this stage will download latest tarball
FROM alpine:latest AS prep
ARG HUGO_ARCH=amd64
RUN \
apk --no-cache upgrade && \
apk --no-cache add curl jq && \
LATEST_RELEASE=$(curl -L -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.tag_name' | sed 's/^v//' ) && \
echo "Using hugo release: ${LATEST_RELEASE}" && \
URL=$(curl -s https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[] | select(.name | test("linux-${HUGO_ARCH}.tar.gz") and test("extended") and (test("withdeploy") | not)) | .browser_download_url') && \
echo "Downloading: ${URL}" && \
wget "${URL}" -O - | tar xzv -C /tmp
##### final image
FROM alpine:latest
COPY --from=prep /tmp/hugo /usr/local/bin/hugo
RUN \
apk --no-cache upgrade && \
apk --no-cache add rclone git gcompat libstdc++
ENTRYPOINT [ "/usr/local/bin/hugo" ]