Truly minimal Docker images for Hugo with batteries included.
These images sets destination
during build and bind
when started as server, otherwise no magic.
Default minimal image based upon Busybox:
- Aliases:
latest
,busybox
,busybox-onbuild
,onbuild
- Hugo 0.64.1:
0.64.1-busybox
,0.64.1
,0.64.1-busybox-onbuild
,0.64.1-onbuild
(Dockerfile) - Hugo 0.64.0:
0.64.0-busybox
,0.64.0
,0.64.0-busybox-onbuild
,0.64.0-onbuild
(Dockerfile) - Hugo 0.63.2:
0.63.2-busybox
,0.63.2
,0.63.2-busybox-onbuild
,0.63.2-onbuild
(Dockerfile) - Hugo 0.63.1:
0.63.1-busybox
,0.63.1
,0.63.1-busybox-onbuild
,0.63.1-onbuild
(Dockerfile)
Minimal image based upon Alpine:
- Aliases:
alpine
,alpine-onbuild
,ext-alpine
,ext-alpine-onbuild
,ext-nodejs
- Hugo 0.64.1:
0.64.1-alpine
,0.64.1-alpine-onbuild
,0.64.1-ext-alpine
,0.64.1-ext-alpine-onbuild
,0.64.1-ext-nodejs
(Dockerfile) - Hugo 0.64.0:
0.64.0-alpine
,0.64.0-alpine-onbuild
,0.64.0-ext-alpine
,0.64.0-ext-alpine-onbuild
,0.64.0-ext-nodejs
(Dockerfile) - Hugo 0.63.2:
0.63.2-alpine
,0.63.2-alpine-onbuild
,0.63.2-ext-alpine
,0.63.2-ext-alpine-onbuild
,0.63.2-ext-nodejs
(Dockerfile) - Hugo 0.63.1:
0.63.1-alpine
,0.63.1-alpine-onbuild
,0.63.1-ext-alpine
,0.63.1-ext-alpine-onbuild
,0.63.1-ext-nodejs
(Dockerfile)
Minimal image based upon Alpine with Asciidoctor installed:
- Aliases:
asciidoctor
,asciidoctor-onbuild
,ext-asciidoctor
,ext-asciidoctor-onbuild
- Hugo 0.64.1:
0.64.1-asciidoctor
,0.64.1-asciidoctor-onbuild
,0.64.1-ext-asciidoctor
,0.64.1-ext-asciidoctor-onbuild
(Dockerfile) - Hugo 0.64.0:
0.64.0-asciidoctor
,0.64.0-asciidoctor-onbuild
,0.64.0-ext-asciidoctor
,0.64.0-ext-asciidoctor-onbuild
(Dockerfile) - Hugo 0.63.2:
0.63.2-asciidoctor
,0.63.2-asciidoctor-onbuild
,0.63.2-ext-asciidoctor
,0.63.2-ext-asciidoctor-onbuild
(Dockerfile) - Hugo 0.63.1:
0.63.1-asciidoctor
,0.63.1-asciidoctor-onbuild
,0.63.1-ext-asciidoctor
,0.63.1-ext-asciidoctor-onbuild
(Dockerfile)
Minimal image based upon Alpine with Pandoc installed:
- Aliases:
pandoc
,pandoc-onbuild
,ext-pandoc
,ext-pandoc-onbuild
- Hugo 0.64.1:
0.64.1-pandoc
,0.64.1-pandoc-onbuild
,0.64.1-ext-pandoc
,0.64.1-ext-pandoc-onbuild
(Dockerfile) - Hugo 0.64.0:
0.64.0-pandoc
,0.64.0-pandoc-onbuild
,0.64.0-ext-pandoc
,0.64.0-ext-pandoc-onbuild
(Dockerfile) - Hugo 0.63.2:
0.63.2-pandoc
,0.63.2-pandoc-onbuild
,0.63.2-ext-pandoc
,0.63.2-ext-pandoc-onbuild
(Dockerfile) - Hugo 0.63.1:
0.63.1-pandoc
,0.63.1-pandoc-onbuild
,0.63.1-ext-pandoc
,0.63.1-ext-pandoc-onbuild
(Dockerfile)
Image based upon Debian:
- Aliases:
debian
,debian-onbuild
,ext
,latest-ext
,ext-debian
,ext-debian-onbuild
,ext-onbuild
- Hugo 0.64.1:
0.64.1-debian
,0.64.1-debian-onbuild
,0.64.1-ext
,0.64.1-ext-debian
,0.64.1-ext-debian-onbuild
,0.64.1-ext-onbuild
(Dockerfile) - Hugo 0.64.0:
0.64.0-debian
,0.64.0-debian-onbuild
,0.64.0-ext
,0.64.0-ext-debian
,0.64.0-ext-debian-onbuild
,0.64.0-ext-onbuild
(Dockerfile) - Hugo 0.63.2:
0.63.2-debian
,0.63.2-debian-onbuild
,0.63.2-ext
,0.63.2-ext-debian
,0.63.2-ext-debian-onbuild
,0.63.2-ext-onbuild
(Dockerfile) - Hugo 0.63.1:
0.63.1-debian
,0.63.1-debian-onbuild
,0.63.1-ext
,0.63.1-ext-debian
,0.63.1-ext-debian-onbuild
,0.63.1-ext-onbuild
(Dockerfile)
Image based upon Ubuntu:
- Aliases:
ubuntu
,ubuntu-onbuild
,ext-ubuntu
,ext-ubuntu-onbuild
- Hugo 0.64.1:
0.64.1-ubuntu
,0.64.1-ubuntu-onbuild
,0.64.1-ext-ubuntu
,0.64.1-ext-ubuntu-onbuild
(Dockerfile) - Hugo 0.64.0:
0.64.0-ubuntu
,0.64.0-ubuntu-onbuild
,0.64.0-ext-ubuntu
,0.64.0-ext-ubuntu-onbuild
(Dockerfile) - Hugo 0.63.2:
0.63.2-ubuntu
,0.63.2-ubuntu-onbuild
,0.63.2-ext-ubuntu
,0.63.2-ext-ubuntu-onbuild
(Dockerfile) - Hugo 0.63.1:
0.63.1-ubuntu
,0.63.1-ubuntu-onbuild
,0.63.1-ext-ubuntu
,0.63.1-ext-ubuntu-onbuild
(Dockerfile)
Looking for older tags? Please see the complete list of tags.
This image does not try to do any fancy. Users may use Hugo just as they are used to.
The good practice of having a separate output folder is part of the image.
Normal build:
docker run --rm -it \
-v $(pwd):/src \
-v $(pwd)/output:/target \
klakegg/hugo:0.64.1
Run server:
docker run --rm -it \
-v $(pwd):/src \
-p 1313:1313 \
klakegg/hugo:0.64.1 \
server
Normal build:
build:
image: klakegg/hugo:0.64.1
volumes:
- .:/src
- ./output:/target
Run server:
server:
image: klakegg/hugo:0.64.1
command: server
volumes:
- .:/src
ports:
- 1313:1313
All versions and variants published using this repository may be used in any combination.
Simple configuration for e.g. .github/workflows/hugo.yml
:
name: Hugo
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: hugo
uses: klakegg/actions-hugo@1.0.0
Find out more in klakegg/actions-hugo.
Simple configuration for .travis.yml
:
language: bash
services:
- docker
script:
- docker run --rm -i \
-v $(pwd):/src \
-v $(pwd)/output:/target \
klakegg/hugo:0.64.1
The bash
environment is used for faster loading before Travis is ready to trigger Docker.
A Hugo shell is made available in the Alpine/Debian/Ubuntu images (including Asciidoctor/Pandoc images). Hugo shell is bash and Hugo completion.
To get into a shell for your site:
docker run --rm -it \
-v $(pwd):/src \
klakegg/hugo:0.64.1-alpine \
shell
The extended edition is used in those images containing ext
in the name. Except use of extended edition and additional tools are those images exactly the same as those using the normal edition.
Table of Hugo extention features and the version when images first support the feature:
Feature | Alpine | Debian | Ubuntu |
---|---|---|---|
Hugo extended | 0.43 | 0.43 | 0.43 |
PostCSS | 0.56.0 | 0.43 | 0.43 |
NodeJS/Yarn | 0.54.0 | 0.54.0 | 0.54.0 |
Git | 0.56.0 | 0.56.0 | 0.56.0 |
Autoprefixer | 0.57.0 | 0.57.0 | 0.57.0 |
Users of google/docsy may use the extended images as of version 0.57.2 to build their site.
The onbuild images adds content of the folder of your Dockerfile into /src
and builds to the /onbuild
folder.
Example Dockerfile for your project where the site is made into an nginx image (Docker 17.05-ce or newer):
FROM klakegg/hugo:0.64.1-onbuild AS hugo
FROM nginx
COPY --from=hugo /onbuild /usr/share/nginx/html
Hugo images with Pandoc support are made available for users wanting to use Pandoc in combination with Hugo.
Hugo triggers Pandoc with pandoc --mathjax
.
Some users may want to use other arguments, so to accommodate such a need is an alias pandoc
created with the content of HUGO_PANDOC
(default: pandoc-default
) upon initiation.
The normal pandoc
executable is renamed to pandoc-default
to allow for later introduction of pandoc-citeproc
if needed.
Example of explicit setting pandoc
alias:
docker run --rm -it \
-v $(pwd):/src \
-v $(pwd)/output:/src/public \
-e HUGO_PANDOC="pandoc-default --strip-empty-paragraphs" \
klakegg/hugo:0.64.1-pandoc
Those wanting to override entrypoint in the image may easily do so.
Default entrypoint is hugo
, a small script wrapping the official Hugo software. If you want to use the official software without any wrapping may you use hugo-official
as entrypoint.
On command line using --entrypoint
:
docker run --rm -it \
-v $(pwd):/src \
-v $(pwd)/output:/src/public \
--entrypoint hugo-official \
klakegg/hugo:0.64.1
In docker-compose using entrypoint
:
build:
image: klakegg/hugo:0.64.1
entrypoint: hugo-official
volumes:
- .:/src
- ./output:/src/public
Environment variables:
- HUGO_BIND - Bind address for server. Default:
0.0.0.0
- HUGO_DESTINATION - Location of output folder. Default:
/target
- HUGO_PANDOC - Pandoc command to be triggered. Default:
pandoc-default
- HUGO_ENV - Selecting environment ("DEV"/"production"). Default:
DEV
Volumes:
/src
- Source folder and workdir/target
- Target folder
Ports:
1313/tcp