Public | Automated Build

Last pushed: 7 months ago
Short Description
Rust cross compilation image for arm-unknown-linux-gnueabihf.
Full Description

rustcross

Dockerized cross compilation for Rust.

This repo

This repository has Dockerfiles to cross-compile Rust programs to different architecture. The Docker Hub has these images as prebuilt images.

Usage

To create a release build using cargo, run this command in your Rust root directory (where you normally run 'cargo ...'):

docker run --rm -v ${PWD}:/work rustcross/__TARGET__:__VERSION__ cargo build --release --target=__TARGET__

Where TARGET is:

  • x86_64-unknown-linux-gnu
  • armv7-unknown-linux-gnueabihf
  • arm-unknown-linux-gnueabihf

and where VERSION is:

  • latest (currently v1.12)
  • 1.12

These versions correspond to Rust versions.

If you are working with one of the ARM targets, you need to tell cargo to use a custom linker when compiling your code, so create .cargo/config and put the following inside:

[target.__TARGET__]
linker = "arm-linux-gnueabihf-gcc"

Where TARGET is:

  • armv7-unknown-linux-gnueabihf
  • arm-unknown-linux-gnueabihf

Source

These images were created from the cross-build images in https://github.com/dockcross/dockcross.

Docker Pull Command
Owner
rustcross
Source Repository

Comments (0)