go-in-5-minutes
go-in-5-minutes copied to clipboard
how to cross-compile and build statically linked binaries
suggested via slack by @mholt
reference for myself: https://labs.ctl.io/small-docker-images-for-go-apps/ and https://medium.com/iron-io-blog/an-easier-way-to-create-tiny-golang-docker-images-7ba2893b160
+1
Make sure to cover cgo for compiling things like sqlite3.
Some suggestions:
Gox makes cross compiling (non cgo apps) a breeze.
Alpine linux makes small linux container images much easier. Apparently the official images are moving in that direction.