Docker files for cross-building Debian packages for other architectures of Rust projects using cargo-deb.
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.
Paul van Tilburg 1dc8e5dea5
Use i386 instead of i686
4 weeks ago
Dockerfile.arm64 Initial import into git 4 weeks ago
Dockerfile.armhf Initial import into git 4 weeks ago
Dockerfile.i686 Initial import into git 4 weeks ago
README.md Use i386 instead of i686 4 weeks ago

README.md

Docker files for cross-builds using cargo-deb

These files allows you to build Debian packages for the (Debian) architectures i386, armhf and arm64 using an amd64 host system.

Note that the Dockerfiles use the full Rust Debian Buster Docker image and not the slim version so that some common build-dependencies (such as libssl-dev) are already present.

Cross-compile to i386

Build the image:

$ docker build . -t cargo-deb-crossbuild/i386 --platform linux/386 -f Dockerfile
STEP 1/5: FROM docker.io/rust:bullseye
Trying to pull docker.io/library/rust:bullseye...
Getting image source signatures
...

In your Rust project, run:

$ docker run --rm -ti -v `pwd`:/app cargo-deb-crossbuild/i386
...
/app/target/debian/<your crate>.deb

You can find the resulting deb file in ./target/debian.

Cross-compile to arm64 (ARM v8)

Build the image:

$ docker build . -t cargo-deb-crossbuild/arm64 --platform linux/arm64/v8 -f Dockerfile
STEP 1/5: FROM docker.io/rust:bullseye
Trying to pull docker.io/library/rust:bullseye...
Getting image source signatures
...

In your Rust project, run:

$ docker run --rm -ti -v `pwd`:/app cargo-deb-crossbuild/arm64
...
/app/target/debian/<your crate>.deb

You can find the resulting deb file in ./target/debian.

Cross-compile to armhf (ARM v7)

Build the image:

$ docker build . -t cargo-deb-crossbuild/armhf --platform linux/arm/v7 -f Dockerfile
STEP 1/5: FROM docker.io/rust:bullseye
Trying to pull docker.io/library/rust:bullseye...
Getting image source signatures
...

In your Rust project, run:

$ docker run --rm -ti -v `pwd`:/app cargo-deb-crossbuild/armhf
...
/app/target/debian/<your crate>.deb

You can find the resulting deb file in ./target/debian.