You can find this image in the link below.
https://hub.docker.com/r/raffaeldutra/docker-gohugo
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.
IMPORTANT: Image tags are the same as GoHugo releaes.
docker build -t raffaeldutra/docker-gohugo:<VERSION> .
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:<VERSION> \
/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.
Code publishment, convert all md files to HTML.
docker run -it \
-v $(pwd):/src \
-v $(pwd)/public:/src/public raffaeldutra/docker-gohugo:<VERSION>
Here is the how you can do it.
docker run -it \
-v $(pwd):/src \
-p 1313:1313 raffaeldutra/docker-gohugo /gohugo.sh -s
docker run -it \
-v $(pwd):/src \
-e BASEURL=192.168.10.10 \
-p 1313:1313 raffaeldutra/docker-gohugo:<VERSION> /gohugo.sh -s