Skip to content
Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Gohugo Docker Image

! ! ! ! !

You can find this image in the link below.

Content for your project

The simplest way is the better way, right? I hope so.

For those who will use Linux:

  • You can share the "current" directory $(pwd) to /src folder inside of Docker container. This folder is used for Hugo.
  • To publish your project, you can use the "public" directory, or whatever you want, but you need to pass the /src/public directory, that's what Hugo expects, at least for now.

How to create a project

Run the command below, but pay attention because it will create a new directory called "my-new-website". Change this for what you want.

docker run --rm -d \
-v $(pwd):/my-new-project \
raffaeldutra/docker-gohugo \
/usr/local/bin/hugo new site /my-new-project/my-new-website

Once created, go to this new directory "my-new-website" and download your template as usual.

How to publish your website

Code publishment, convert all md files to HTML.

docker run -it \
-v $(pwd):/src \
-v $(pwd)/public:/src/public raffaeldutra/docker-gohugo

How to run a server

Here is the how you can do it.

docker run -it \
-v $(pwd):/src \
-p 1313:1313 raffaeldutra/docker-gohugo / -s

How to run a server in a different URL

docker run -it \
-v $(pwd):/src \
-p 1313:1313 raffaeldutra/docker-gohugo / -s
You can’t perform that action at this time.