@tobi: golang alpine image with cgo for sqlite3

Picking up go is a lot of fun! So does a few of my colleagues :-) Tobi M. (“the destroyer”) asked if i have a solution to run a golang docker image with the go-sqlite3 driver I remembered to had the same problem, so after my post about really small docker images, lets add a few more bytes! the solution This solution is not my own, i found and tried other solutions but stayed with this Dockerfile on github...

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

Tags