Docker Hugo screenshot

Docker Hugo

Author Avatar Theme by Klakegg
Updated: 5 Jun 2023
397 Stars

Truly minimal Docker images for Hugo open-source static site generator.

Overview

The HugoDocker Pulls is a collection of minimal Docker images for Hugo, a popular static site generator. These images are designed to be lightweight and efficient, while still providing all the necessary dependencies for running Hugo. The images include different variations, such as different base images (Busybox, Alpine, Debian, Ubuntu) and optional installations of additional tools like Asciidoctor and Pandoc. Users can choose the image that best suits their needs and easily get started with running Hugo in a Docker container.

Features

  • Minimal Docker images: The images are designed to be minimal, only including the necessary dependencies for running Hugo.
  • Variety of base images: The images are available with different base images, including Busybox, Alpine, Debian, and Ubuntu, allowing users to choose the image that best fits their requirements.
  • Optional installations of additional tools: Some images come with optional installations of additional tools like Asciidoctor and Pandoc, providing users with more functionality if needed.
  • Hugo shell: The Alpine, Debian, and Ubuntu images, including the ones with additional tools, come with a Hugo shell, which is a bash environment with Hugo completion. This allows users to easily interact with their Hugo site within the Docker container.

Installation

To use the HugoDocker Pulls images, follow these steps:

  1. Choose the appropriate image based on your requirements. You can select the base image (e.g., Busybox, Alpine, Debian, Ubuntu) and any additional tools you need (e.g., Asciidoctor, Pandoc). Refer to the available tags to find the right combination of image and tools.

  2. Pull the desired image from Docker Hub using the docker pull command. For example, to pull the minimal image based on Alpine without any additional tools:

    docker pull klakegg/hugo:0.112.0-alpine
    
  3. Once the image is pulled, you can use it to run Hugo commands. For example, to build your Hugo site:

    docker run --rm -v $(pwd):/src klakegg/hugo:0.112.0-alpine hugo
    
  4. If you need to run the Hugo server, you can add the server command after the image name. For example:

    docker run --rm -v $(pwd):/src -p 1313:1313 klakegg/hugo:0.112.0-alpine hugo server
    
  5. If you are using the Hugo shell in the Alpine, Debian, or Ubuntu images, you can access it by running the container with interactive mode and a terminal:

    docker run -it --rm -v $(pwd):/src klakegg/hugo:0.112.0-alpine /bin/bash
    
  6. You can now interact with your Hugo site using the Hugo shell commands.

Summary

The HugoDocker Pulls are a collection of minimal Docker images for running Hugo. These images provide a lightweight and efficient way of using Hugo in a Docker container. Users can choose the image that best suits their needs, with options for different base images and optional installations of additional tools. The images also include a Hugo shell, allowing users to easily interact with their Hugo site within the Docker container. By using these images, users can quickly set up and run Hugo without the need to install dependencies on their local machine.