Provides a Dockerfile
defining a Rust build environment for the ESP32 and ESP8266. Builds LLVM and Rust with support for the Xtensa ISA.
For more information on the Xtensa Rust toolchain, refer to the following repositories:
https://github.com/esp-rs/rust
https://github.com/MabezDev/xtensa-rust-quickstart
Ensure that Docker is installed on your system. At least 4GB of RAM (6GB+ recommended) should be available to the container; too little memory can cause the build to fail. Note that this process can be lengthy, potentially taking hours depending on your hardware. Please be patient.
To build the image (tagging it with the name rust-esp
):
$ git clone https://github.com/esp-rs/docker-rust-esp.git
$ cd docker-rust-esp/
$ docker build -t rust-esp .
Once the image has been built, from the root directory of your project (ie. that containing Cargo.toml
), run:
$ docker run -v $PWD:/project --rm rust-esp
This will build the application using xargo
in release
mode, targeting the architecture specified in your .cargo/config
file.
https://github.com/japaric/xargo
Alternatively if you would prefer an interactive session:
$ docker run -v $PWD:/project -it --rm rust-esp /bin/bash