Skip to content

Instantly share code, notes, and snippets.

@gaoconghui
Created July 17, 2018 09:54
Show Gist options
  • Save gaoconghui/66bc4699c624f5a5833db42c08c0c55d to your computer and use it in GitHub Desktop.
Save gaoconghui/66bc4699c624f5a5833db42c08c0c55d to your computer and use it in GitHub Desktop.
使用docker环境来build go
docker run --rm -it -v "$GOPATH":/go -w /go/build/path dockercore/golang-cross:1.10.2 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