Alice Rhodes

I found a great tutorial, but it was missing a step.

Great start

I absolutely love this walk through for getting set up for Rust on ESP32

https://blog.billvanleeuwen.ca/crafting-a-hello-world-in-rust-for-the-esp-32-a-step-by-step-guide

Con

Using Docker like that is going to create non-reusable container. That Docker command will create a new container every time you run it.

This means you’re gonna fill your hard drive up with a lot of builds if you compile as often as I do. Also, every new container means cargo is going to download all the libraries every time. So you’re using up space and bandwidth.

Pro-Tactics

Many thanks to SocketWench for coaching in Docker basics a few years ago. I remembered I could setup reusable containers using Docker Compose.

My recall was rough and I would describe the experience as someone trying a bicycle for the first time in years in falling over a few times before finally making their way down the road.

However, I got up and running with some help from composerize which you can paste someone’s docker run command into and get back the start of a docker compose file.

composer.yml

name: lilygo-tdeck-pro-rs
services:
    idf-rust:
        stdin_open: true
        tty: true
        volumes:
            - $PWD:/home/esp/project
        image: espressif/idf-rust:esp32s3_1.90.0.0
        command: /bin/bash

With this file you can run docker compose up -d to start the container. The -d flag is to say run it detached, running it in the background. The to connect to the container you can run docker-compose exec idf-rust /bin/bash which will drop you into /home/esp and you can cd into your project directory to compile.