Build Go fat binary without installing Go on your machine. This requires Docker though.
- Copy
go-build.shandDockerfileto your project's root folder. - Run
./go-build.sh(this may requirechmod +x go-build.sh)
After successfull execution a file named app should appear in your project's root folder.
- Doesn't require a Go installation on the machine.
- By changing Go image version in the
Dockerfileit is possible to build your sources with different versions of Go. - Randomized image names allow to run two or more builds simultaniously.
- Requires Docker installed.
- May result in garbage docker images if
docker runwithin build.sh has failed for some reason (never happened to me). It is possible to check for such images by runningdocker images | grep go_build_image