Make the build work in Docker as well

This commit is contained in:
2025-08-16 17:25:11 +02:00
parent 7ac1cd75a9
commit cdbed3883a
2 changed files with 3 additions and 19 deletions
+2 -11
View File
@@ -1,19 +1,10 @@
FROM debian AS builder
RUN apt-get update \
&& apt-get install -y curl jq git \
&& ARCH=$(uname -m | sed -e 's/x86_/amd/' -e 's/aarch/arm/') \
&& echo ">>> ARCH $ARCH" \
&& URL=$(curl -sS -H 'Accept: appliction/vnd.github.v3+json' https://api.github.com/repos/gohugoio/hugo/releases/latest | jq -r '.assets[] | select(.name | test("hugo_[^e].*linux-'$ARCH'.tar.gz")) | .browser_download_url') \
&& echo ">>> URL $URL" \
&& curl -sSL -o hugo.tar.gz $URL \
&& tar -C /usr/local/bin -xf hugo.tar.gz hugo
RUN apt-get update && apt-get install -y curl git
COPY . /site
WORKDIR /site
RUN hugo
RUN ./build.sh
FROM nginx
+1 -8
View File
@@ -3,16 +3,10 @@
set -euo pipefail
HUGO_VERSION=0.148.2
GO_VERSION=1.24.5
export TZ=Europe/Oslo
# Install Go
echo "Installing Go ${GO_VERSION}..."
curl -sLJO "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz"
tar -C "${HOME}/.local" -xf "go${GO_VERSION}.linux-amd64.tar.gz"
rm "go${GO_VERSION}.linux-amd64.tar.gz"
export PATH="${HOME}/.local/go/bin:${PATH}"
mkdir -p "${HOME}/.local"
# Install Hugo
echo "Installing Hugo ${HUGO_VERSION}..."
@@ -24,7 +18,6 @@ export PATH="${HOME}/.local/hugo:${PATH}"
# Verify installations
echo "Verifying installations..."
echo Go: "$(go version)"
echo Hugo: "$(hugo version)"
# Configure Git