Skip to content

Instantly share code, notes, and snippets.

@treeder
Last active October 28, 2015 19:12
Show Gist options
  • Save treeder/5478e78201b2a246c0a4 to your computer and use it in GitHub Desktop.
Save treeder/5478e78201b2a246c0a4 to your computer and use it in GitHub Desktop.
Cross compiling golang with Docker
docker run --rm -it -v "$GOPATH":/go -w /go/src/github.com/iron-io/ironcli golang:1.4.2-cross sh -c '
for GOOS in darwin linux windows; do
for GOARCH in 386 amd64; do
echo "Building $GOOS-$GOARCH"
export GOOS=$GOOS
export GOARCH=$GOARCH
go build -o bin/ironcli-$GOOS-$GOARCH
done
done
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment