Sign inSign up

bdebyl/hugo

By bdebyl

•Updated about 6 years ago

Docker image to run Hugo static site generator with multi-arch builds.

Image
0

1.6K

bdebyl/hugo repository overview

⁠Alpine Hugo Docker image

This is a Alpine based Docker image used to wrap Hugo

Builds are automated from bdebyl/docker-hugo⁠ tags using GitLab pipelines.

size pipeline

⁠Usage

The basic entrypoint of the docker image is the hugo binary. This means it's as simple as running the following command (for help):

docker run bdebyl/hugo help

Note: It is recommended to append the --rm option after docker run to keep things clean, or naming your container appropriately for re-use.

⁠Example

The following example should be used for reference when running the server with all necessary options:

docker run -it --rm --user $(id -u $USER):$(id -g $USER) -v /home/bastian/src/bdebyl-site:/src -p 1313:1313/tcp bdebyl/hugo server --bind=0.0.0.0

⁠Server

To run the server, it's key to recall Hugo's bind interface⁠ and specify it appropriately.

Example:

docker run bdebyl/hugo server --bind=0.0.0.0

⁠Ports

The image only exposes Hugo's default port of 1313. Make sure to expose it during runtime.

⁠Volume

The image expects source code for a Hugo site, including a theme, to be mounted to the containers /src directory. This could be done via:

docker run -v /absolute/path/to/source:/src bdebyl/hugo

Example Source Directory Structure:

.
├── config.toml
├── content
│   └── post
└── themes
    └── theme_name

Tag summary

Content type

Image

Digest

Size

38.3 MB

Last updated

about 6 years ago

docker pull bdebyl/hugo