Sign inSign up

simpledocker/hugo

By simpledocker

•Updated over 2 years ago

Hugo open-source static site generator Docker images: slim version and CI utilities version.

Image
Developer tools
Web servers
Content management system
1

2.4K

simpledocker/hugo repository overview

⁠Hugo in docker

Hugo⁠ is one of the most popular open-source static site generators, known for its remarkable speed and flexibility. Hugo makes building websites enjoyable again.

This unofficial Docker image offers a wide selection of distributions. It is utilized by several product companies and is now available to the community.

⁠Tags

  • latest - the simplest way to start using the image with the latest Hugo version.
  • 0, 0.125, or 0.125.0 - specifies a fixed Hugo version.
⁠Ubuntu-based tags
  • ubuntu - the latest Hugo version based on the latest LTS Ubuntu version.
  • ubuntu-rolling - the latest Hugo version based on the ubuntu:rolling image.
  • mantic, mantic-20240405 - the latest Hugo version based on a specified Ubuntu release. Refer to the official Ubuntu image tags for details.
  • 0.125-mantic, 0.125.0-mantic, 0.125.0-mantic-20240405 - the most reliable way to fix both Hugo and Ubuntu versions.
⁠-slim Suffix

Images such as ubuntu-slim or mantic-20240405-slim do not include additional packages like Git and are lighter in weight.

⁠-ci Suffix

Images such as ubuntu-ci or mantic-20240405-ci are heavier because they include additional software like AWS CLI. Additionally, they do not set hugo as the entrypoint to simplify use in pipelines like GitLab CI/GitHub Actions.

⁠Alpine-based tags
  • alpine - the latest Hugo version based on the latest Alpine version.
  • alpine3.19 - the latest Hugo version based on the alpine:3.19 image.
  • 0.125-alpine, 0.125.0-alpine, 0.125-alpine3.19, 0.125.0-alpine3.19 - the most reliable way to fix both Hugo and Alpine versions.

⁠Examples

⁠Create a New Project
docker run -v $(pwd):/src simpledocker/hugo new site quickstart
⁠Build a Static Site in Docker

Navigate to your Hugo project directory and execute the following command:

docker run -v $(pwd):/src simpledocker/hugo
⁠Running Hugo Server with Docker Compose

Here is an example docker-compose.yml for setting up a Hugo server:

services:
  hugo:
    image: simpledocker/hugo:latest
    command: serve
    ports:
      - '1313:1313'
    volumes:
      - ./:/src
⁠Gitlab CI

Here is an example gitlab-ci.yml for setting up Hugo in Gitlab CI:

stages:
  - build

hugo-build:
  image: simpledocker/hugo:latest-ci
  stage: build
  script:
    - git submodule update --init --recursive
    - hugo
    - ls -l public # Your static site is here, deploy whatever you want!

⁠Feedback Channel

If you encounter any bugs or have suggestions, please feel free to email them to [email protected]⁠.

Tag summary

Content type

Image

Digest

sha256:991ed757a…

Size

128.1 MB

Last updated

over 2 years ago

docker pull simpledocker/hugo:0-latest-ci