From dc0d9fc5d701b8bcbcc93e57646adb4bb34de1f3 Mon Sep 17 00:00:00 2001 From: formych Date: Sun, 21 Apr 2019 12:47:57 +0800 Subject: [PATCH] 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 --- golang/content.md | 1 + 1 file changed, 1 insertion(+) diff --git a/golang/content.md b/golang/content.md index 99eadce128a0..da5bb4a7ff63 100644 --- a/golang/content.md +++ b/golang/content.md @@ -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