docker-hugo/Dockerfile

27 lines
795 B
Docker
Raw Permalink Normal View History

##### this stage will download latest tarball
2024-05-02 07:48:54 +00:00
FROM alpine:latest as prep
2022-10-02 14:55:45 +00:00
2023-02-14 00:46:59 +00:00
ARG HUGO_ARCH=amd64
2022-12-26 10:42:13 +00:00
2024-05-02 07:48:54 +00:00
RUN \
2024-05-25 17:34:49 +00:00
apk --no-cache upgrade && \
apk --no-cache add curl jq && \
LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://github.com/gohugoio/hugo/releases/latest | jq --raw-output ".tag_name" | sed 's/^v//' ) && \
2024-12-16 14:17:43 +00:00
LATEST_RELEASE=0.139.4 && \
URL="https://github.com/gohugoio/hugo/releases/download/v${LATEST_RELEASE}/hugo_extended_${LATEST_RELEASE}_linux-${HUGO_ARCH}.tar.gz " && \
echo "Downloading: ${URL}" && \
wget "${URL}" -O - | tar xzv -C /tmp
2024-05-08 20:16:38 +00:00
2024-05-02 07:48:54 +00:00
##### final image
2024-05-02 08:21:57 +00:00
FROM alpine:latest
2024-05-02 07:48:54 +00:00
2024-05-02 08:21:57 +00:00
COPY --from=prep /tmp/hugo /usr/local/bin/hugo
2022-10-02 14:55:45 +00:00
2023-02-14 00:37:57 +00:00
RUN \
2024-05-02 08:21:57 +00:00
apk --no-cache upgrade && \
2024-08-06 12:09:02 +00:00
apk --no-cache add git gcompat libstdc++
2023-02-14 00:37:57 +00:00
ENTRYPOINT [ "/usr/local/bin/hugo" ]