docker-hugo/Dockerfile
paspo 4894e1419c
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 17s
get rid of lastversion github ratelimit problem
2024-06-12 08:38:32 +02:00

26 lines
759 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 -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 " && \
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 gcompat libstdc++
ENTRYPOINT [ "/usr/local/bin/hugo" ]