IoT and Docker: Using the Espressif Docker Image for ESP32 Development

Use Case:

Use the ESP32 IDF Docker Image from Espressif and create binaries for the ESP32-Lyradt Boards. The Docker Image will be used interactively.

The ESP32 ADF will be local on the Linux Host.

We get the ADF Environment with the command:

git clone –recursive

Mount a local host directory inside Docker Image

docker run –rm -v $PWD:/project -w /project -it espressif/idf

Access USB port  /dev/ttyUSB0

sudo docker run –rm –privileged -v $PWD:/project -w /project -it espressif/idf

or (more secure)

sudo docker run –rm –device=/dev/ttyUSB0 -e ADF_PATH=/project -v $PWD:/project -w /project -it espressif/idf

With Env Var like ADF_PATH

sudo docker run –rm –privileged -e ADF_PATH=/project -v $PWD:/project -w /project -it espressif/idf

Available commands: build (build with CMake) flash monitor
xtensa-esp32-elf-gcc --version
make -version 
cmake -version
make menuconfig
make && make flash monitor (build with GNU Make)

Flashing: flash

If you have problems then push "Boot" Button and "RST" Button and release first the RST Button.

Possible Problems

How to access the host USB Port

Missing Headers (ADF):


git fetch

git checkout v2.0

git submodule update –init –recursive

Devices in Containers on Windows


Other example of ESP32 Development with Docker (2years old)

Complete IDF and ADF Dev. Environment

Espressif Docker Section

ESP32 Dockerized Tool Chain

Docker image rebuilds all every time, doesn't do incremental build
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: