Skip to content

Uberspace/docker-hugo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hugo CMS

This is an Alpine Docker image with the Hugo CMS binary installed.

🚸 Usage

It's entry point is set to /usr/local/bin/hugo. If run, the default command will run under root from / with ./site as input and ../public as output.

docker run --rm \
  --volume "$(pwd)/input":/site \
  --volume "$(pwd)/output":/public \
  uberspace/hugo

Note: you can use --user $(id -u):$(id -g) — or similar — to preserve your file ownership.

👷 CI

You could also use the image in the CI for your project, similar to this:

hugo:
  stage: build
  image: uberspace/hugo

Or use your own entry point:

hugo:
  stage: build
  image:
    name: uberspace/hugo
    entrypoint: [""]
  script:
    - /usr/local/bin/hugo --source page --destination /var/www --minify

🚀 Deployment

Pushes to main trigger builds on Docker Hub.