Truly minimal Docker images for Hugo with batteries included.
These images sets bind
when started as server, otherwise no magic.
Default minimal image based upon Busybox:
latest
, busybox
, busybox-ci
, ci
, busybox-onbuild
, onbuild
0.139.2-busybox
, 0.139.2
, 0.139.2-busybox-ci
, 0.139.2-ci
, 0.139.2-busybox-onbuild
, 0.139.2-onbuild
Minimal image based upon Alpine:
alpine
, alpine-ci
, alpine-onbuild
, ext-alpine
, ext-alpine-ci
, ext-alpine-onbuild
0.139.2-alpine
, 0.139.2-alpine-ci
, 0.139.2-alpine-onbuild
, 0.139.2-ext-alpine
, 0.139.2-ext-alpine-ci
, 0.139.2-ext-alpine-onbuild
Minimal image based upon Alpine with Asciidoctor installed:
asciidoctor
, asciidoctor-ci
, asciidoctor-onbuild
, ext-asciidoctor
, ext-asciidoctor-ci
, ext-asciidoctor-onbuild
0.139.2-asciidoctor
, 0.139.2-asciidoctor-onbuild
, 0.139.2-asciidoctor-ci
, 0.139.2-ext-asciidoctor
, 0.139.2-ext-asciidoctor-ci
, 0.139.2-ext-asciidoctor-onbuild
Minimal image based upon Alpine with Pandoc installed:
pandoc
, pandoc-ci
, pandoc-onbuild
, ext-pandoc
, ext-pandoc-ci
, ext-pandoc-onbuild
0.139.2-pandoc
, 0.139.2-pandoc-ci
, 0.139.2-pandoc-onbuild
, 0.139.2-ext-pandoc
, 0.139.2-ext-pandoc-ci
, 0.139.2-ext-pandoc-onbuild
Image based upon Debian:
debian
, debian-ci
, debian-onbuild
, ext
, latest-ext
, ext-debian
, ext-debian-ci
, ext-ci
, ext-debian-onbuild
, ext-onbuild
0.139.2-debian
, 0.139.2-debian-ci
, 0.139.2-debian-onbuild
, 0.139.2-ext
, 0.139.2-ext-debian
, 0.139.2-ext-debian-ci
, 0.139.2-ext-ci
,0.139.2-ext-debian-onbuild
, 0.139.2-ext-onbuild
Image based upon Ubuntu:
ubuntu
, ubuntu-ci
, ubuntu-onbuild
, ext-ubuntu
, ext-ubuntu-ci
, ext-ubuntu-onbuild
0.139.2-ubuntu
, 0.139.2-ubuntu-ci
, 0.139.2-ubuntu-onbuild
, 0.139.2-ext-ubuntu
, 0.139.2-ext-ubuntu-ci
, 0.139.2-ext-ubuntu-onbuild
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.
Normal build:
docker run --rm -it \
-v $(pwd):/src \
floryn90/hugo:0.139.2
Run server:
docker run --rm -it \
-v $(pwd):/src \
-p 1313:1313 \
floryn90/hugo:0.139.2 \
server
Normal build:
build:
image: floryn90/hugo:0.139.2
volumes:
- ".:/src"
Run server:
server:
image: floryn90/hugo:0.139.2
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@v4
- name: hugo
uses: floryn90/actions-hugo@1.0.0
Find out more in floryn90/actions-hugo.
Simple configuration for .travis.yml
:
language: bash
services:
- docker
script:
- docker run --rm -i \
-v $(pwd):/src \
floryn90/hugo:0.139.2
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 \
floryn90/hugo:0.139.2-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 extension 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 | 0.54.0 | 0.54.0 | 0.54.0 |
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 |
Go | 0.68.0 | 0.68.0 | 0.68.0 |
Babel | 0.71.0 | 0.71.0 | 0.71.0 |
rst2html | 0.81.0 | 0.81.0 | 0.81.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 /target
(prior to 0.68.0
: /onbuild
) folder.
Example Dockerfile for your project where the site is made into an nginx image (Docker 17.05-ce or newer):
FROM floryn90/hugo:0.139.2-onbuild AS hugo
FROM nginx
COPY --from=hugo /target /usr/share/nginx/html
Available arguments for docker build
:
/target
DEV
/src
The ci
images are prepared for use in configuration for continuous integration/deployment.
Difference between normal images and ci
images:
HUGO_ENV
: production
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 pandoc
executable is renamed to pandoc-default
as a new pandoc
script is provided to handle the HUGO_PANDOC
environment variable.
Example of explicit setting pandoc
alias:
docker run --rm -it \
-v $(pwd):/src \
-e HUGO_PANDOC="pandoc-default --strip-empty-paragraphs" \
floryn90/hugo:0.139.2-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 \
--entrypoint hugo-official \
floryn90/hugo:0.139.2
In docker-compose using entrypoint
:
build:
image: floryn90/hugo:0.139.2
entrypoint: hugo-official
volumes:
- ".:/src"
Software | Version |
---|---|
Go | 1.20.1 |
NodeJS | 19.x |
Pandoc | 3.1 |
Yarn | 1.58.3 |
Environment variables:
0.0.0.0
/tmp
public
pandoc-default
DEV
Ports:
1313/tcp