Description
The purpose of this issue is to solicit community feedback and hopefully reach some consensus.
As of v0.135.0 I can do things like1:
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 config
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 env
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 list all
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 new foo.md
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 server
But I can't build the site like this:
docker run -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0
Instead, I have to pass an empty entry point:
docker run --rm -v .:/site -u $(id -u):$(id -g) --entrypoint "" ghcr.io/gohugoio/hugo:v0.135.0 hugo
Or pass in a CLI flag to override the default --help
flag defined in the Dockerfile. For example:
docker run --rm -v .:/site -u $(id -u):$(id -g) ghcr.io/gohugoio/hugo:v0.135.0 --minify
Additionally, the current version:
- Is not the extended version
- Does not support Hugo modules
- Does not support AsciiDoc, Pandoc, or reStructuredText (which is probably fine)
- Does not support PostCSS
- Does not support GitInfo
- Does not write to host cache directory (
cacheDir
/HUGO_CACHEDIR
/os.CacheDir
) - I'm not sure if css.TailwindCSS works
Now that we can build an image, it would be good to define what we actually want it to do.
Some time ago I created a repository to test docker images:
https://github.com/jmooring/hugo-feature-test
Our Docker image doesn't need to pass that test, but we should consider what we want to support.
There's an open issue about how to document usage:
gohugoio/hugoDocs#2727
Footnotes
-
The
-u $(id -u):$(id -g)
flag is required to set correct permissions on published files. Without this, owner and group were set to root during my Linux testing. ↩