Created
August 25, 2016 18:47
-
-
Save michaelconnor00/27d3e2e2cd673dbd359bebfdfcee519e to your computer and use it in GitHub Desktop.
From https://www.iron.io/an-easier-way-to-create-tiny-golang-docker-images/ Build Go static binaries.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment