go-fatbinary
Build Go fat binary without installing Go on your machine. This requires Docker though.
- Copy
go-build.sh
andDockerfile
to 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.
Pros:
- Doesn't require a Go installation on the machine.
- By changing Go image version in the
Dockerfile
it is possible to build your sources with different versions of Go. - Randomized image names allow to run two or more builds simultaniously.
Cons:
- Requires Docker installed.
- May result in garbage docker images if
docker run
within 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