Sign inSign up

raffaeldutra/docker-gohugo

By raffaeldutra

•Updated almost 6 years ago

Docker image for GoHugo pages.

Image
1

3.3K

raffaeldutra/docker-gohugo repository overview

⁠Gohugo Docker Image

! ! ! ! !

You can find this image in the link below.

https://hub.docker.com/r/raffaeldutra/docker-gohugo⁠

⁠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.

IMPORTANT: Image tags are the same as GoHugo releaes.

⁠Building an image

docker build -t raffaeldutra/docker-gohugo:<VERSION> .

⁠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:<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.

⁠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:<VERSION>

⁠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 /gohugo.sh -s

⁠How to run a server in a different URL

docker run -it \
-v $(pwd):/src \
-e BASEURL=192.168.10.10 \
-p 1313:1313 raffaeldutra/docker-gohugo:<VERSION> /gohugo.sh -s

Tag summary

Content type

Image

Digest

Size

39.6 MB

Last updated

almost 6 years ago

docker pull raffaeldutra/docker-gohugo