Base image for Hugo - a fast and modern static website engine.
1.1K
This is a base image for working with Hugo - a fast and modern static website engine. It can either be used to run arbitrary Hugo commands for your project or as a base image for your custom container.
The default entrypoint runs the plain hugocommand. Via command parameters the command which should be used to run Hugo can be selected and parameterized. For example running docker run ... fbrx/hugo server -D -F will result in running hugo server -D -F inside the container.
The image can be used to run Hugo commands for your project. Since the container needs the Hugo site data available, the correct folder has to be supplied in the docker runcommand via the -v parameter to be mounted at /site.
See Volumes for an example and further detail.
When used as a base image, the image expects to be build from a Hugo project root. Meaning you should have a folder structure as follows when building a container:
basePath/
|-- archetypes/
|-- content/
|-- layouts/
|-- public/
|-- static/
|-- themes/
|-- config.toml
|-- Dockerfile
A sample Dockerfile may look like follows:
FROM fbrx/hugo
MAINTAINER me
# customizes the default command when the container is run. The arguments will be supplied to the hugo command.
CMD ["server", "-b", "myhost"]
The default entrypoint of the image performs the following steps:
Dockerfile or arguments to docker run)The default will just call hugo without any arguments which will just rebuild your site.
When run, the image expects a Hugo site structure at /site. When used as a base image, the contents of the current folder will be added to this folder.
When the image is used "standalone", the folder which should be used has to be specified via the -v flag to the docker run command.
Example to use the current directory: docker run --rm -p 1313:1313 -v ${PWD}:/site fbrx/hugo
When the image is used to run your site via hugo server in conjunction with boot2docker, you have to supply the IP or hostname of your boot2docker host as the baseUrl to the hugo command.
Example: docker run --rm -p 1313:1313 -v ${PWD}:/site fbrx/hugo server -b 192.168.59.103
The IP of the boot2docker host can be obtained by simply running boot2docker ip.
Content type
Image
Digest
sha256:55e1b3686…
Size
87.3 MB
Last updated
over 7 years ago
docker pull fbrx/hugo