You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To build an executable for another platform than the current platform (Docker is running on a Linux OS) you've to set the GOOS environment variable. So you can build executable binaries for MacOS (darwin) and Windows platforms.
GOOS=darwin GOARCH=amd64 go build
GOOS=windows GOARCH=386 go build
GOOS=linux GOARCH=amd64 go build
To find out which platform you've to define for your current system, you can install the node module go-platform. This return the current os and cpu-architecture.
The text was updated successfully, but these errors were encountered:
janbaer
changed the title
How can I build a Go executable in a Docker container that is runnable on MacOS
How can I build a Go executable in a Docker container that can be executed on MacOS or Windows
Aug 27, 2016
To build an executable for another platform than the current platform (Docker is running on a Linux OS) you've to set the GOOS environment variable. So you can build executable binaries for MacOS (darwin) and Windows platforms.
To find out which platform you've to define for your current system, you can install the node module go-platform. This return the current os and cpu-architecture.
The text was updated successfully, but these errors were encountered: