2024-06-12 08:38:32 +02:00
|
|
|
##### this stage will download latest tarball
|
2024-05-02 09:48:54 +02:00
|
|
|
|
|
|
|
FROM alpine:latest as prep
|
2022-10-02 16:55:45 +02:00
|
|
|
|
2023-02-14 01:46:59 +01:00
|
|
|
ARG HUGO_ARCH=amd64
|
2022-12-26 11:42:13 +01:00
|
|
|
|
2024-05-02 09:48:54 +02:00
|
|
|
RUN \
|
2024-05-25 19:34:49 +02:00
|
|
|
apk --no-cache upgrade && \
|
2024-06-12 08:38:32 +02:00
|
|
|
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//' ) && \
|
|
|
|
URL="https://github.com/gohugoio/hugo/releases/download/v${LATEST_RELEASE}/hugo_extended_${LATEST_RELEASE}_linux-${HUGO_ARCH}.tar.gz " && \
|
2024-05-08 22:03:50 +02:00
|
|
|
echo "Downloading: ${URL}" && \
|
|
|
|
wget "${URL}" -O - | tar xzv -C /tmp
|
2024-05-08 22:16:38 +02:00
|
|
|
|
2024-05-02 09:48:54 +02:00
|
|
|
##### final image
|
|
|
|
|
2024-05-02 10:21:57 +02:00
|
|
|
FROM alpine:latest
|
2024-05-02 09:48:54 +02:00
|
|
|
|
2024-05-02 10:21:57 +02:00
|
|
|
COPY --from=prep /tmp/hugo /usr/local/bin/hugo
|
2022-10-02 16:55:45 +02:00
|
|
|
|
2023-02-14 01:37:57 +01:00
|
|
|
RUN \
|
2024-05-02 10:21:57 +02:00
|
|
|
apk --no-cache upgrade && \
|
2024-08-06 14:09:02 +02:00
|
|
|
apk --no-cache add git gcompat libstdc++
|
2023-02-14 01:37:57 +01:00
|
|
|
|
|
|
|
ENTRYPOINT [ "/usr/local/bin/hugo" ]
|