Introducing Docker Hugo - a CircleCI 2.0 Ready Docker Image

I’ve created and maintain several websites that are statically-generated with Hugo (including the one you’re reading right now). I build and test these sites with CircleCI. With CircleCI 2.0, the build process is heavily Docker based. I made a Docker image for use with CircleCI that has Hugo to build the site and HTMLProofer to test it.

Here’s my blog post if you’d like to read more: https://feliciano.tech/blog/introducing-docker-hugo/

I visit this forum frequently so feel free to comment on my blog or here, I’ll see either.

One note from me, I’ve seen several Docker images for Hugo now. One things I can say for mine which I haven’t always seen for the others is that this will be maintained. I don’t really have a choice as I use it for several sites. :stuck_out_tongue:

5 Likes

Also created a little logo and shared on Product Hunt. Any feedback would be greatly appreciated, especially if you use Hugo on Travis CI as I’ve only tested this image on CircleCI so far.

Thanks for making and maintaining the Hugo docker image. Very helpful! :slight_smile:

One tip for people who also land on this topic through Google search, the CircleCI code example for this Docker image on GitHub is incorrect.

There it reads:

docker:
  - image: felicianotech/docker-hugo:0.50

This should be:

docker:
  - image: cibuilds/hugo:0.50

Else you’ll get the ‘Error response from daemon: manifest for felicianotech/docker-hugo:0.50 not found’ error message in CircleCI.

Just a heads up for other people who want to try CircleCI and immediately get such an error. :+1:

2 Likes

Thank you for bringing attention to this. I’ve updated the readme in the repo.

1 Like

Thank you again for making the Hugo docker image. I really like working with the image, and the included html-proofer works good too! Also props to CircleCI because it’s pretty cool what’s possible with their service, even with their generous free plan. :+1: :slight_smile:

1 Like

Does the Hugo CircleCI image also has Go for Hugo Modules? I can’t figure it out from the ‘image layers’ information on Docker.

(I figured this old topic is the best resource for general Hugo CircleCI questions.)

Great question. The answer is no. I created the image way before Hugo ever had module support and thus needed Go.

The immediate solution would be to use the CircleCI Go orb in order to install Go on the fly into the build: https://circleci.com/orbs/registry/orb/circleci/go

I will update the image and get Go added into it very soon (less than 48 hours hopefully). I will update here once that is done.

1 Like

Thanks for the reply Ricardo!

Well if I’m the only one asking, there’s no need to add it specially. Attaching the Go orb should also work fine. :slight_smile:

No I think this was a good request. Go is now needed to fully support Hugo.

The image has been updated. You can see the PR here. The next release of Hugo, whatever that may be, will include Go in the image.

If you want to use an image with Go in it right now, you can use cibuilds/hugo:edge. I would suggest using this as a temporary tag until the next release comes out.

1 Like

Thank you! :+1: I’m looking forward to the next Hugo release. Yesterday I already did a quick test with hugo:edge and looks good to me. :slightly_smiling_face:

Also thanks for keeping the CircleCI Hugo image up to date. It’s very easy to use and runs quick.

1 Like