Undefined Title

Build on docker with golang

2017-03-14

Sometimes I ran into cases that I could not do cross compile with golang on Mac OS. I use official docker image like this then.

DIR=/.go/src/github.com/tmtk75/envaws
docker run --rm \
	-v "$PWD":"$DIR" \
	-w "$DIR" \
	-e GOPATH=/.go \
	-e GOARCH=amd64 \
	-e GOOS=linux \
	golang:1.8 \
	go build \
	-ldflags="-extldflags \"-static\"" \
	-o envaws_linux_amd64 \
	.