https://github.com/rfratto/viceroy
Docker base image for C cross compilers
https://github.com/rfratto/viceroy
c cross-compilation docker go
Last synced: 7 months ago
JSON representation
Docker base image for C cross compilers
- Host: GitHub
- URL: https://github.com/rfratto/viceroy
- Owner: rfratto
- License: apache-2.0
- Created: 2022-01-17T23:42:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-18T03:09:44.000Z (over 1 year ago)
- Last Synced: 2025-03-19T05:42:15.604Z (7 months ago)
- Topics: c, cross-compilation, docker, go
- Language: Dockerfile
- Homepage:
- Size: 194 KB
- Stars: 13
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
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.## Supported Platforms
Viceroy examines the following environment variables to determine which target
system to cross-compile for:* `VICEROYOS` (or `GOOS`)
* `VICEROYARCH` (or `GOARCH`)
* `VICEROYARM` (or `GOARM`)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 | | | |## Usage
1. Use `rfratto/viceroy` as your Docker base image.
2. Set `CC=viceroycc`.
3. Set `VICEROYOS`, `VICEROYARCH`, and `VICEROYARM` as appropriate.
4. Compile!## Building locally
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.[osxcross]: https://github.com/tpoechtrager/osxcross
## Legal note
OSX/Darwin/Apple builds:
**[Please ensure you have read and understood the Xcode license
terms before continuing.](https://www.apple.com/legal/sla/docs/xcode.pdf)**