michaelconnor00
8/25/2016 - 6:47 PM

From https://www.iron.io/an-easier-way-to-create-tiny-golang-docker-images/ Build Go static binaries.

docker run --rm -it -v "$GOPATH":/gopath -v "$(pwd)":/app -e "GOPATH=/gopath" -w /app golang:1.4.2 sh -c 'CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o hello'