Container bases for cross-compiling for ARMv7 and i686 targets on an x86-64 host.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.4 KiB

Cross Build

Provides a Dockerfile to build a container that supports cross compilation for ARMv7 and i686 targets from x86-64 hosts.

This project was created out of a need to have a single-shot process for building a few Rust projects with stripped binaries featuring static C-runtimes for:

  • armv7-unknown-linux-gnueabihf
  • i686-unknown-linux-gnu

While cross exists, and is far more full featured, the project lags behind in updating the base OS, GCC, and QEMU versions used (as of this writing).

An example exists that handles my specific use case for one project, and might serve as inspiration for modifications to suit more complicated needs.


Using podman since I do not have docker itself installed:

# Assuming you have cloned this repository and are in the repo
$ cd docker
$ podman build -t crossbuild:dev -f ./Dockerfile


Again using podman and assuming you're in the repository:

$ podman run --rm \
	-e REPO_URL="" \
	-e BIN_NAME="connchk" -v ./example/:/opt/build \
	crossbuild:dev /opt/build/

# ...

$ tree example
├── armv7-unknown-linux-gnueabihf_connchk
├── i686-unknown-linux-gnu_connchk

$ file example/*_connchk
example/armv7-unknown-linux-gnueabihf_connchk: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), statically linked, BuildID[sha1]=00811fa9637b6abf243fb707a8970b0cea43ba4f, for GNU/Linux 3.2.0, stripped
example/i686-unknown-linux-gnu_connchk:        ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, BuildID[sha1]=6e1d92bb01aed5b0adb673b1dfbe5fb28cf5da18, for GNU/Linux 3.2.0, stripped


Licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


To discuss features, offer assistance, or get help please join the project's Matrix room.