-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (23 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
29 lines (23 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM ubuntu:24.04
ARG HUGO_VERSION=0.148.2
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates nodejs npm tar wget \
&& npm install -g sass-embedded \
&& rm -rf /var/lib/apt/lists/*
RUN TARGETARCH="${TARGETARCH:-$(dpkg --print-architecture)}" \
&& case "${TARGETARCH}" in \
amd64) HUGO_ARCH="amd64" ;; \
arm64) HUGO_ARCH="arm64" ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" >&2; exit 1 ;; \
esac \
&& HUGO_TARBALL="hugo_extended_${HUGO_VERSION}_linux-${HUGO_ARCH}.tar.gz" \
&& wget -q -O "/tmp/${HUGO_TARBALL}" "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_TARBALL}" \
&& wget -q -O /tmp/hugo_checksums.txt "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_checksums.txt" \
&& grep " ${HUGO_TARBALL}\$" /tmp/hugo_checksums.txt > /tmp/hugo_checksums_entry.txt \
&& sha256sum -c /tmp/hugo_checksums_entry.txt \
&& tar -xzf "/tmp/${HUGO_TARBALL}" -C /usr/local/bin hugo \
&& rm -f "/tmp/${HUGO_TARBALL}" /tmp/hugo_checksums.txt /tmp/hugo_checksums_entry.txt
WORKDIR /src
EXPOSE 1313
CMD ["hugo", "server", "--bind", "0.0.0.0", "--baseURL", "http://127.0.0.1:1313", "--buildDrafts", "--disableFastRender"]