taken from https://gitlab.com/Spindel/rust-cross-example
docker build -t stuartnelson3rust-cross-compiler-arm .
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