From 0ce532965cd25bc99915676ea42b64e1c1e6a62e Mon Sep 17 00:00:00 2001
From: Sergio Talens-Oliag <sto@mixinet.net>
Date: Sat, 15 Mar 2025 10:30:17 +0100
Subject: [PATCH] feat(hugo-adoc): initial image

---
 hugo-adoc/Dockerfile | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 hugo-adoc/Dockerfile

diff --git a/hugo-adoc/Dockerfile b/hugo-adoc/Dockerfile
new file mode 100644
index 0000000..db60d26
--- /dev/null
+++ b/hugo-adoc/Dockerfile
@@ -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 [""]