Public | Automated Build

Last pushed: 21 days ago
Short Description
The smallest hugo image built from Alpine.
Full Description

docker-hugo

The smallest hugo image built from Alpine.

Install




docker pull yanqd0/hugo

Usage

There are two simple ways to use the image when developing,
docker run or docker-compose up.

(If you want to know the usage of hugo, please visit gohugo.io.)

docker run

As the help of hugo server says:

Hugo provides its own webserver which builds and serves the site.
While hugo server is high performance, it is a webserver with limited options.
Many run it in production, but the standard behavior is for people to use it
in development and use a more full featured server such as Nginx or Caddy.

hugo server will avoid writing the rendered and served content to disk,
preferring to store it in memory.

The default command of this docker image is hugo server.

When generating the public directory in the production environment,
please specify the command to hugo.

docker run --rm -v $PWD:/srv/hugo yanqd0/hugo hugo

If the current directory is not the hugo project, you can replace $PWD with the path.

docker-compose up

It may not be a convenient way to use docker run in the development environment.

I prefer to use a docker-compose.yml file.

You can write a docker-compose.yml in your hugo project like this:

version: '3'

services:
  hugo:
    image: yanqd0/hugo
    volumes:
      - .:/srv/hugo
    ports:
      - 1313:1313

And then, run docker-compose up -d.

There is a verified docker-compose.yml for example.

Version

Name Version
Alpine 3.6
Hugo 0.31
Git 2.13.5

It is welcome to remind me about updates by issue.

Size

Status Size
Compressed
Extracted 52.7 MB

I use the official releases instead of compiling from source, so the image is very small.

License

MIT License

Copyright (c) 2017 Yan QiDong yanqd0@outlook.com

Docker Pull Command
Owner
yanqd0
Source Repository