1
0
Fork 0

feat(hugo-adoc): initial image
All checks were successful
multi-semantic-release / multi-semantic-release (push) Successful in 21s

This commit is contained in:
Sergio Talens-Oliag 2025-03-15 10:30:17 +01:00
parent d5172592ef
commit 0ce532965c
Signed by: sto
GPG key ID: 821AEE0FD167FBDF

33
hugo-adoc/Dockerfile Normal file
View file

@ -0,0 +1,33 @@
FROM golang:1.24.1-alpine3.21 AS build
ARG HUGO_BUILD_TAGS=extended
ARG CGO=1
ENV CGO_ENABLED=${CGO}
ENV GOOS=linux
ENV GO111MODULE=on
ENV HUGO_VERSION=v0.145.0
ENV MAGE_VERSION=v1.15.0
WORKDIR /go/src/github.com/gohugoio/hugo
RUN apk update &&\
# gcc/g++ are required to build SASS libraries for extended version
apk add --no-cache curl gcc g++ musl-dev git &&\
download_url="https://api.github.com/repos/gohugoio/hugo/tarball/${HUGO_VERSION}" &&\
echo "$download_url" &&\
curl -sL "$download_url" -o /tmp/hugo.tgz &&\
tar xf /tmp/hugo.tgz -C . --strip-components=1 &&\
go install github.com/magefile/mage@${MAGE_VERSION} &&\
mage hugo &&\
mage install &&\
cd / &&\
rm -rf /tmp/hugo.tgz /go/src/github.com/gohugoio/hugo/*
FROM asciidoctor/docker-asciidoctor:1.82
COPY --from=build /go/bin/hugo /usr/bin/hugo
RUN gem install --no-document asciidoctor-html5s &&\
apk update &&\
apk add --no-cache ca-certificates libc6-compat libstdc++ git &&\
/usr/bin/hugo version &&\
rm -rf /var/cache/apk/*
# Expose port for live server
EXPOSE 1313
ENTRYPOINT ["/usr/bin/hugo"]
CMD [""]