Hugo Docker screenshot

Hugo Docker

Author Avatar Theme by Hubci
Updated: 23 May 2025
65 Stars

A Docker image for Hugo, the static-site generator. This image focuses on a CI use-case, not production. Includes HTMLProofer for testing.

Overview:

HubCI is a Docker image for Hugo, a static-site generator. It includes HTMLProofer for testing purposes and is hosted on Docker Hub. This Docker image is primarily designed to be used as a base image on CircleCI for building, testing, and deploying Hugo-based websites. The goal is to expand its usability for local testing and build/test/deploy on other CI providers in the future.

Features:

  • Docker image for Hugo static-site generator
  • Includes HTMLProofer for testing
  • Designed for use on CircleCI for building, testing, and deploying Hugo-based websites
  • Potential for future compatibility with other CI providers

Installation:

To use HubCI on CircleCI, follow these steps:

  1. Add the following configuration to your .circleci/config.yml file:
version: 0.96.0

Note: You can specify a complete SemVer version number to pin to a specific release. Alternatively, you can use a simplified version number (e.g., 0.96) to automatically use newer versions as they are released. You can even use “nightly” to use the latest in-development version.

  1. Ensure that your Hugo files are in a directory called “src” within your repository. A complete walkthrough can be found on CircleCI’s blog.

To prepare new images, run the following commands:

  1. Run ./shared/gen-dockerfiles.sh locally, specifying the desired Hugo versions to be supported. For example, for the initial release, run ./shared/gen-dockerfiles.sh 0.96.0. This will generate the Dockerfiles and build scripts.

  2. For proper releases, run the ./shared/release.sh script. This script not only runs gen-dockerfiles.sh but also handles all the necessary Git work to publish a proper release. Add the [release] flag to the commit message to initiate a release.

Summary:

HubCI is a Docker image for Hugo that simplifies the process of building, testing, and deploying Hugo-based websites. It includes HTMLProofer for testing purposes and is designed to be used on CircleCI. The HubCI image can be easily installed by adding the appropriate configuration to the CircleCI configuration file. In the future, the aim is to make the image compatible with other CI providers as well. Users can contribute to the project by reporting issues or bugs on GitHub, posting on Hugo’s forum, or submitting pull requests.