Sign inSign up

mongrelion/hugo

By mongrelion

Updated almost 7 years ago

A Fast and Flexible Static Site Generator built with love in GoLang http://gohugo.io

Image
0

610

mongrelion/hugo repository overview

Hugo Docker container

Build Status

This image is based on official Alpine lightweight Docker image.

Building this image

In order to build this image to need to pass the version of Hugo that you want to install in the container.

$ docker --build-arg HUGO_VERSION=0.20.1 build -t mongrelion/hugo:0.20.1
Running it

Make sure that when you run the container you mount your Hugo site to /usr/share/hugo. For the rest, you can call any of the available Hugo commands.

Here is an example on running the Hugo server:

$ docker run --rm -it -p 1313:1313 -v $PWD:/usr/share/hugo mongrelion/hugo:0.20.1 server --bind 0.0.0.0

Notice that we're asking Hugo to bind to the 0.0.0.0 interface because by default it binds itself to 127.0.0.1, rejecting all the connections coming outside of the container.

To generate your site simply

$ docker run --rm -it -v $PWD:/usr/share/hugo mongrelion/hugo:0.20.1

This should produce the contents of your website under the public/ directory.

Tag summary

Content type

Image

Digest

Size

28 MB

Last updated

about 9 years ago

docker pull mongrelion/hugo