hugo-docker/README.md
2024-10-06 21:13:42 +02:00

1,011 B

Creating Docker Container for Hugo

Hugo 0.135.0 - amd64 - Ubuntu 24.04

Replace podman with docker in the commands - been using Podman

Build Container

git clone https://git.ittavern.com/CaffeineFueled/hugo-docker.git

cd hugo-docker

podman build -t hugo-docker:0.135.0 .

Run hugo commands like this:

podman run --rm \
    -p 1313:1313 \
    -v $PWD:/content \
    localhost/hugo-docker:0.135.0 \
    server --bind 0.0.0.0

Run in directory of Hugo page

Add to config:

alias hugo="podman run --rm -p 1313:1313 -v $PWD:/content localhost/hugo-docker:0.135.0"

Assuming the default port is being used and Hugo page is in the current directory

Official Docker Image

They just announced a tagged Hugo Docker Image in their Release Notes of the current version. You should use the offiicial Docker Image! - This a learning projects.