/rust-crosscompile-arm

docker container for cross compiling rust to arm

Primary LanguageShellApache License 2.0Apache-2.0

rust cross compiler

taken from https://gitlab.com/Spindel/rust-cross-example

build

docker build -t stuartnelson3rust-cross-compiler-arm .

example usage

example usage in a makefile, where current working directory contains your rust code.

note that this caches crates on the local machine for faster builds.

CARGO ?= docker run -it --rm \
	-v $(CURDIR):$(CURDIR) \
	-v ~/.cargo/git:/cargo/git \
	-v ~/.cargo/registry:/cargo/registry \
	-w $(CURDIR) stuartnelson3/rust-crosscompiler-arm cargo

build:
  $(CARGO) build --release