authelia/crossbuild

Sponsored OSS

By authelia

Updated 3 months ago

Cross-compilation CI/CD Container

Image
Integration & Delivery
Internet of Things
Operating Systems

4.3K

crossbuild

:earth_africa: multiarch cross compiling environments

This is a multiarch Docker build environment image. You can use this image to produce binaries for multiple architectures.

Supported targets

TripleAliaseslinuxfreebsd
x86_64-linux-gnu(default), linux, amd64, x86_64
arm-linux-gnueabihfarmhf, armv7, armv7l
aarch64-linux-gnuarm64, aarch64
x86_64-pc-freebsd14freebsd

Using crossbuild

x86_64

$ docker run --rm -v $(pwd):/workdir authelia/crossbuild make helloworld
cc helloworld.c -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=9cfb3d5b46cba98c5aa99db67398afbebb270cb9, not stripped

Misc: using cc instead of make

$ docker run --rm -v $(pwd):/workdir authelia/crossbuild cc test/helloworld.c

armhf

$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=arm-linux-gnueabihf authelia/crossbuild make helloworld

arm64

$ docker run --rm -v $(pwd):/workdir -e CROSS_TRIPLE=aarch64-linux-gnu authelia/crossbuild make helloworld

freebsd x86_64

$ docker run -it --rm -v $(pwd):/workdir -e CROSS_TRIPLE=x86_64-pc-freebsd14  authelia/crossbuild make helloworld

Credit

This project is inspired by the cross-compiler by the venerable Steeve Morin

License

MIT

Docker Pull Command

docker pull authelia/crossbuild