prometheus_wireguard_exporter/.cargo/config.toml
Quentin McGaw 3a74f8b5b0
Multi arch Dockerfile and CI (#63)
* Modify Dockerfile
- Use rustup from Docker image
- Give up on cross compilation (ring issue)
- Remove useless duplicate cargo install step
- No need to specify target as it is built statically for the docker platform targeted
- Shorten binary path output for shorter COPY

* Github Actions to build for all ARM as well

* Remove unneded musl-dev

* Adapt build for all platforms
- Use Debian based Rust for compilation
- Cross compile on build platform
- Compile static binaries using musl
- Set variables correctly for all Docker supported platforms
- Note: ppc64le, s390x and riscv64 do not support the Rust standard lib
- Persist target platform variables through files
- Define linkers in .cargo/config
- Cache dependencies properly for target platform
- Scratch stage to test the binary for target platform

* Add 386 arch to CI

* Use buildkit for docker build

* Only build for amd64 on branches

* Fix dependencies caching

* Split dependencies fetching and compilation

* Documentation

* Build for all architectures on branch

* Add STATIC build argument

* Documentation
2021-07-08 09:17:51 +02:00

25 lines
654 B
TOML

# This is used in the Docker build, you might need to adjust it for local usage.
[target.x86_64-unknown-linux-musl]
linker = "x86_64-linux-musl-gcc"
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
[target.armv7-unknown-linux-musleabi]
linker = "armv7m-linux-musleabi-gcc"
[target.arm-unknown-linux-musleabi]
linker = "armv6-linux-musleabi-gcc"
[target.i686-unknown-linux-musl]
linker = "i686-linux-musl-gcc"
[target.powerpc64le-unknown-linux-musl]
linker = "powerpc64le-linux-musl-gcc"
[target.s390x-unknown-linux-musl]
linker = "s390x-linux-musl-gcc"
[target.riscv64gc-unknown-linux-musl]
linker = "riscv64-linux-musl-gcc"