Sign inSign up

orianna/hugo

By orianna

•Updated about 8 years ago

Docker image for Hugo

Image
1

350

orianna/hugo repository overview

⁠hugo-docker-dev

Docker image for Hugo⁠.

Please check the orianna-zzo/hugo-docker-dev⁠ for more details.

You can build static sites generated by Hugo with this docker image. The development environment dependencies are defined in the docker image, and the site's files and data are stored in the local disk in the host. Any changes in the directory of {content, layouts, static, themes} will be directly reflected in the static sites.

The directory structure of the site is as follows:

.
└── site
    ├── config.toml / config.yaml / config.json
    ├── content
    │   └── ...
    ├── layouts
    │   └── ...
    ├── themes
    │   └── ...
    ├── static
    │   └── ...
    ├── archetypes
    │   └── ...
    ├── data
    │   └── ...
    └── ...

Please check the official website⁠ for more information about Hugo!

⁠Get the Image

Here⁠ is the image on the Docker Hub. The compressed size is only 32MB. You can simply pull the latest image by:

$ docker pull orianna/hugo

Check the image, and this image is only 85.3MB now:

$ docker images

⁠Run the Container

Run the docker container:

$ docker run --name my-hugo -v $(pwd)/site-sample:/hugo-site -v $(pwd)/public:/static-site -p 1313:1313 --rm -it orianna/hugo:latest

To simplify it, you can config alias in ~/.profile as follows:

alias hugo="docker run -it --rm -v \$(pwd)/site-sample:/hugo-site -v $(pwd)/public:/static-site -p 1313:1313 orianna/hugo:latest"

With this alias, you can use the dart-sass image as if you use hugo command locally:

$ hugo version                      
$ hugo -h                      

If you want to use shell in the container interactively, you can enter:

$ docker run --name my-hugo -v $(pwd)/site-sample:/hugo-site -v $(pwd)/public:/static-site -p 1313:1313 --rm -it --entrypoint sh orianna/hugo:latest

⁠Tag Version

⁠v0.46: == latest

Hugo: v0.46. Alpine: v3.8

Tag summary

Content type

Image

Digest

Size

31.5 MB

Last updated

about 8 years ago

docker pull orianna/hugo