building go binaries for small docker images

building docker images with go should be super easy - picking a minimal image (in my case I build from alpine), build the binary, ADD to the image, run… the problem your app is not starting, instead you see something like this standard_init_linux.go:195: exec user process caused "no such file or directory" cause: several modules are calling C code via cgo, and cgo depends on libc. Go found libc on the system it was build on, so it linked to it....

Last posts