Viceroy is a base Docker image which provides a viceroycc
binary to cross
compile to multiple architectures. It was designed to help ease the burden of
cross compiling Go projects which have C dependencies.
Viceroy is not very useful on its own; it should be extended to add libraries and other tools needed to build projects.
Viceroy examines the following environment variables to determine which target system to cross-compile for:
VICEROYOS
(orGOOS
)VICEROYARCH
(orGOARCH
)VICEROYARM
(orGOARM
)
These environment variables determine which compiler toolchain to use and some
defaults for environment variables (such as LD_LIBRARY_PATH
). The environment
variables will default to values appropriate for the worker container's
environment when unspecified.
The following target platforms are currently supported:
linux | darwin | freebsd | windows | |
---|---|---|---|---|
amd64 | x | x | x | x |
386 | x | x | x | |
armv5 | x | |||
armv6 | x | |||
armv7 | x | |||
arm64 | x | x | x | |
ppc64le | x | |||
s390x | x |
- Use
rfratto/viceroy
as your Docker base image. - Set
CC=viceroycc
. - Set
VICEROYOS
,VICEROYARCH
, andVICEROYARM
as appropriate. - Compile!
The Viceroy image can be built for your local platform by running make build
.
The OSXCROSS_SDK_URL
environment variable should be set to a URL or path on
the host machine to a .tar.xz of an osxcross packaged macOS 11.1 SDK.
OSX/Darwin/Apple builds: Please ensure you have read and understood the Xcode license terms before continuing.