From ad2066cf60c8c48317adf6272f4b8f201045e50e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Mich=C3=A1lek?= Date: Tue, 7 Sep 2021 15:32:47 +0200 Subject: [PATCH] container: add podman, monitor and flashing (#31) * container: add podman, monitor and flashing --- .../workflows/publish-idf-rust-examples-image.yml | 2 +- Dockerfile | 2 +- README.md | 12 +++++++++++- support/idf-rust-examples/motd | 15 ++++++++------- 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish-idf-rust-examples-image.yml b/.github/workflows/publish-idf-rust-examples-image.yml index 881641f..474f95c 100644 --- a/.github/workflows/publish-idf-rust-examples-image.yml +++ b/.github/workflows/publish-idf-rust-examples-image.yml @@ -1,4 +1,4 @@ -name: Publish idf-rust image on DockerHub +name: Publish idf-rust-examples image on DockerHub on: workflow_dispatch diff --git a/Dockerfile b/Dockerfile index 380a73c..80257d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ RUN apt update \ && apt install -y vim nano # Dependency for Cargo first example -RUN cargo install cargo-pio +RUN cargo install cargo-pio ldproxy espflash COPY support/idf-rust-examples/entrypoint.sh /opt/esp/entrypoint.sh COPY support/idf-rust-examples/motd /etc/motd diff --git a/README.md b/README.md index e01c294..d1c8d42 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,17 @@ First, install the ESP-IDF SDK as shown in the [Get Started](https://docs.espres To support the Xtensa instruction set, build and install custom LLVM and Rust toolchains as shown in the [Rust On Xtensa](docs/rust-on-xtensa.md) guide. -Alternatively you might build the project in the container where image already contains pre-installed Rust and ESP-IDF: +#### Podman/Docker image + +Alternatively you might build the project in the container where image already contains pre-installed Rust and ESP-IDF. + +Podman example with mapping multiple /dev/ttyUSB from host computer to the container: + +``` +podman run -it espressif/idf-rust-examples --device /dev/ttyUSB0 --device /dev/ttyUSB1 +``` + +Docker (does not support flashing from container): ``` docker run -it espressif/idf-rust-examples diff --git a/support/idf-rust-examples/motd b/support/idf-rust-examples/motd index a59626f..a39dcde 100644 --- a/support/idf-rust-examples/motd +++ b/support/idf-rust-examples/motd @@ -5,15 +5,16 @@ Available examples: +* "cargo-first" approach + ```sh + cd /opt/rust-esp32-std-hello + cargo build --release + espflash /dev/ttyUSB0 target/xtensa-esp32-espidf/release/rust-esp32-std-hello + cargo pio espidf monitor -e release /dev/ttyUSB0 + ``` + * "idf.py-first" approach - integration via CMake files ```sh cd /opt/rust-esp32-example idf.py build ``` - -* "cargo-first" approach - ```sh - cd /opt/rust-esp32-std-hello - cargo build --release - ``` -