Sign inSign up

codycraven/hugo

By codycraven

•Updated over 9 years ago

A Docker image from scratch for running the incredibly awesome static site generator Hugo.

Image
0

916

codycraven/hugo repository overview

Docker Hub⁠ | GitHub⁠ | Hugo Website⁠

⁠Supported tags

⁠Usage

⁠Setup aliases for dockerized Hugo

Define a couple aliases in your .bashrc (or other relevant location) to run Hugo in a Docker container.

Note: You can pin your alias to a specific release by appending codycraven/hugo with the Docker tag. Example: codycraven/hugo:0.18.1

⁠hugo
alias hugo='docker run --rm -it \
    -v /tmp:/tmp:Z \
    -v $(pwd):/site:Z \
    -w /site \
    codycraven/hugo'
⁠hugo-server
alias hugo-server='docker run --rm -it \
    -v /tmp:/tmp:Z \
    -v $(pwd):/site:Z -w /site \
    -p 8080:8080 \
    codycraven/hugo \
    server \
    --bind=0.0.0.0 \
    --port=8080 \
    -w'

Note: To set the port of your development site, change all three instances of 8080 to whatever port you'd like to use.

⁠View help
hugo --help
⁠Check the version of Hugo
hugo version
⁠Create a Hugo site
hugo new site mysite

This will create a new directory under your current directory with the name of mysite.

⁠Hugo server
hugo-server
⁠Build static files for deployment
hugo

⁠About Hugo

If you're new to Hugo, be sure to read the Getting Started guide⁠. There's more you'll need to know about Hugo to effectively make use of it, such as installing/creating a theme.

This project is not involved with the Hugo project in any way. I simply love using Docker for managing my tools and love Hugo's flexibility and performance.

Lastly, if you browse the source of this repo, you'll notice there are files within the build-assets directory. The Dockerfile⁠ was written by me, Cody Craven⁠. All other assets in that directory are from the latest release of Hugo⁠. These assets are used by Docker Hub⁠ to automatically build the latest tag for the Docker image.

Tag summary

Content type

Image

Digest

Size

5.4 MB

Last updated

over 9 years ago

docker pull codycraven/hugo