A dockerfile to build hugo https://gohugo.io for Debian, Ubuntu etc.
Docker or Podman (preferred) is a prerequisite, but any old version will do (we are not doing anything fancy).
This only builds the binary, but since Golang application by design do not have runtime depedencies it is
perfectly fine to just sudo cp
the resulting binary into /usr/local/bin/
and be done with it.
Update VERSION
inside Makefile
to a more recent stable version when the time comes ;) and send me the pull request if
I miss it. Similarly update GO_REL
to a more recent Golang release at the appropriate time.
make
sudo cp dist/hugo /usr/local/bin/
sudo chown root:root /usr/local/bin/hugo
The actual build is running inside docker build
(and not docker run, as one might expect). To delete build files, do docker image rm build-hugo-$USER
afterwards.
Enjoy!
I am not the best person to answer build question, I simply followed the instructions at https://gohugo.io/getting-started/installing/#source
There is also https://github.com/Bronek/build-gitea