This image does one thing well: generate the fastest web site via Hugo.
It uses Hugo, colorize code via Pygments, minify the code then generate brotli and gzip precompressed files so Caddy can serve the precompressed version directly from disk with zero CPU over HTTPS via its native LetEncrypt support.
Visit https://hub.docker.com/r/marcaruel/hugo-tidy/tags/ to see the current tags.
- Fast. Generating a simple site takes 1.6 seconds, including syntax highlighting
- Runs as single step
- minifies the
.js
,.css
and.html
- pre-generates
.br
and.gz
files for high performance web serving - images are properly tagged, so you know what versions are running
- Hugo input must be in
./site
- Generated website is in
./www
docker run --rm -u $(id -u):$(id -g) -v $(pwd):/data marcaruel/hugo-tidy:latest
Note: it is highly recommended to pin to a specific version listed at hub.docker.com/r/marcaruel/hugo-tidy/tags/.
Override ALPINE_VERSION
, BROTLI_VERSION
, HUGO_VERSION
, PYGMENTS_VERSION
to select newer versions.
Override REPO
to have it push to your repository.
To push an image on your name with a new version of Hugo, run the following:
make push HUGO_VERSION=0.99.1 REPO=user/repo
When searching for a Docker image with Hugo and Pygments included, I found many but they were all in poor condition in different ways. Many do not have tags, others use :latest so are not reproducible, many uses containers that are neededlessly large, others forces you on on what it ran run, none minified, the rest was stale. How to fix it? By creating yet-another-image, obviously!
A sample of images (!) as of 2017-03-11:
- https://github.com/alrayyes/docker-alpine-hugo-git-bash : Took inspiration, but was stale.
- https://github.com/ctrlok/docker-hugo : Not meant to be used directly, stale.
- https://github.com/giantswarm/hugo-docker : very stale
- https://github.com/jojomi/docker-hugo : Awesome but doesn't contain pygment
- https://github.com/jonathanbp/docker-alpine-hugo : Good but stale.
- https://github.com/Lexty/docker-hugo : Took inspiration, but was missing tags and was stale and the Makefile was weirdo.
- https://github.com/piotrkubisa/hugo-docker-images : Too heavy, includes golang
- https://github.com/publysher/docker-hugo : Too heavy, uses debian wheezy (too old too)
- https://github.com/wpk-/docker-hugo : Too heavy, includes golang and node