FIX: Cross-compile

Cross-compile your app inside the Docker container
I do that, found it not worked right, then i do this ,it's ok!

fix GOOS GOARCH

fix GOOS GOARCH
This commit is contained in:
formych 2019-04-21 12:47:57 +08:00 committed by renruifeng
parent e1803d78a0
commit dc0d9fc5d7
1 changed files with 1 additions and 0 deletions

View File

@ -59,6 +59,7 @@ Alternatively, you can build for multiple platforms at once:
$ docker run --rm -it -v "$PWD":/usr/src/myapp -w /usr/src/myapp %%IMAGE%%:1.8 bash
$ for GOOS in darwin linux; do
> for GOARCH in 386 amd64; do
> export GOOS GOARCH
> go build -v -o myapp-$GOOS-$GOARCH
> done
> done