nicdoye/hugo is a bare-bones Docker image for static sites generated with Hugo.
It is intended to be used as part of a CI/CD pipeline, or locally as a replacement for having hugo installed.
There are two versions:
nicdoye/hugo:[<VERSION>-]busybox which works in CI solutions.nicdoye/hugo:[latest|<VERSION>] which is even smaller.Docker Hub states they are 7 & 6MB (compressed) respectively. The image that I'd previously used is listed as 99MB.
A version built from busybox is also available that gives you more options to play with.
This image is meant to be used in a CI pipeline. As an example, in CircleCI 2.0, you could use the following:
version: 2
jobs:
build:
docker:
- image: nicdoye/hugo:busybox
steps:
- checkout
- run: hugo
Obviously, if run from the command-line, one has to call hugo when you run it. e.g.
docker run --rm -v ${HUGO_DIRECTORY}:/hugo nicdoye/hugo:busybox hugo -s /hugo
A really tiny version is based on the scratch image, which means is roughly the same size as hugo binary itself.
hugoIf you have checked out the contents of your hugo tree in ${HUGO_DIRECTORY}, you can build your site via the following (instead of hugo -s ${HUGO_DIRECTORY}).
docker run --rm -v ${HUGO_DIRECTORY}:/hugo nicdoye/hugo -s /hugo
You can also use it to serve your site while developing locally. Note this also means you can easily pick and choose which version of hugo you want, by picking the relevant tag.
docker run --rm -v ${HUGO_DIRECTORY}:/hugo -p 1313:1313 nicdoye/hugo:0.40.3 -s /hugo --bind 0.0.0.0 serve
The folder /hugo is purely arbitrary, you can pretty much use whatever you want, as long as you use the same name in both locations (the docker volume mount, and after hugo's -s).
Obviously, you have to bind to something other than the default (localhost), hence the --bind.
Content type
Image
Digest
Size
5.9 MB
Last updated
over 8 years ago
docker pull nicdoye/hugo