Compiling Go Binaries with Alpine Docker

So, previously, I discussed how to setup a Self Compiling Go Docker Container. One of the issues I came across while doing so was getting reflex compiled correctly for the alpine environment. I’m quoting directly from this repo: Because alpine linux and therefor gliderlabs/alpine docker containers use musl instead gnu libc, your golang binaries build using libc will not work on alpine. You can further read up on wikipedia on what musl is.

Self Compiling Go with Docker

Imagine a self contained development environment that could detect that there’s a file change on my file system, kill an existing go binary, rebuild the go binary, and then, launch a new process. Introduction I believe that setting up a docker container that self compiles my Go source upon changes within a local development environment will assist myself and colleagues iterate faster. I am a remote engineer with a mix of other disciplines on my team that are new to the language.