website Docker & Self-Hosted Deployment

GitHub

Kubernetes website and documentation repo:

5,330 stars HTML HTML 1 file ยท ~4,602 tokens
1. Pull Image (DOCKERHUB) docker pull kubernetes/website:latest
2. Docker Run (1-Click Launch) docker run -d --name website -p 1313:1313 --restart always kubernetes/website:latest
3. Podman Run podman run -d --name website -p 1313:1313 --restart always kubernetes/website:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://docker.io/kubernetes/website:latest
5. ORAS Pull (OCI Artifact) oras pull kubernetes/website:latest
Dockerfile
# Credit to Julien Guyomard (https://github.com/jguyomard). This Dockerfile
# is essentially based on his Dockerfile at
# https://github.com/jguyomard/docker-hugo/blob/master/Dockerfile. The only significant
# change is that the Hugo version is now an overridable argument rather than a fixed
# environment variable.

FROM docker.io/library/golang:1.25-alpine

RUN apk add --no-cache \
    curl \
    gcc \
    g++ \
    musl-dev \
    build-base \
    libc6-compat

ARG HUGO_VERSION

RUN mkdir $HOME/src && \
    cd $HOME/src && \
    curl -L https://github.com/gohugoio/hugo/archive/refs/tags/v${HUGO_VERSION}.tar.gz | tar -xz && \
    cd "hugo-${HUGO_VERSION}" && \
    go install --tags extended

FROM docker.io/library/golang:1.25-alpine

RUN apk add --no-cache \
    runuser \
    git \
    gcompat \
    openssh-client \
    rsync \
    npm

RUN mkdir -p /var/hugo && \
    addgroup -Sg 1000 hugo && \
    adduser -Sg hugo -u 1000 -h /var/hugo hugo && \
    chown -R hugo: /var/hugo && \
    runuser -u hugo -- git config --global --add safe.directory /src

COPY --from=0 /go/bin/hugo /usr/local/bin/hugo

WORKDIR /src
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts

USER hugo:hugo

EXPOSE 1313