Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

JustNopIt
Posts: 22
Joined: Wed Jul 13, 2016 10:14 am

Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby JustNopIt » Mon Oct 24, 2016 7:57 pm

For those of you who don't know what Docker is: It allows you to automatically generate containers which are similar to a vm, but use way less resources and can be used like an executable. After you ran it, it simply resets, so you can't break anything.
And the best thing: You don't have to install all the dependencies and the SDK(s). And it just WORKS on any system that runs docker.
So I created two docker images: One for the "ESP32 and ESP31b" and one for the "ESP8266 and ESP8266EX".
If you are interested check it out on Github: https://github.com/T-vK/docker-esp-sdk/tree/esp32

To build the docker image you just have to install docker and run these three lines:

Code: Select all

git clone -b esp32 https://github.com/T-vK/docker-esp-sdk.git
cd docker-esp-sdk
sudo docker build -t tavk/esp32-sdk:0.1.0 .
Usage is super simple:

Compiling

Code: Select all

sudo docker run -t -i -u esp \
-v /home/debian/esp-idf/examples/01_hello_world:/home/esp/shared_project \
tavk/esp32-sdk:0.1.0 \
make all
Flashing

Code: Select all

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/debian/esp-idf/examples/01_hello_world:/home/esp/shared_project \
tavk/esp32-sdk:0.1.0 \
make flash
More detailed info on Github:
https://github.com/T-vK/docker-esp-sdk/tree/esp32

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby kolban » Mon Oct 24, 2016 8:23 pm

This looks great. Have you considered merging this story with Eclipse Che to not only provide a Docker image for compilation but also linking this with a full IDE and project workspace?

https://www.eclipse.org/che/
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

JustNopIt
Posts: 22
Joined: Wed Jul 13, 2016 10:14 am

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby JustNopIt » Mon Oct 24, 2016 9:37 pm

Well, since my docker image can be executed as if it was an executable file, it should be a fairly straight forward task for someone who knows Eclipse Che. But I haven't used that ide yet, so I don't know how this would work.

But just to clarify: Generally speaking the ide and the project folder cannot be inside the docker image.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby ESP_igrr » Mon Oct 24, 2016 11:53 pm

Great job!

By the way we also have a docker image which is used for CI builds internally. It it available from docker hub: espressif/esp32-ci-env

We will be updating it soon with new builds of gcc (4.8.5 and 5.2.0). Current 4.8.5 gcc has been found to have a bug in floating point division code.

JustNopIt
Posts: 22
Joined: Wed Jul 13, 2016 10:14 am

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby JustNopIt » Tue Oct 25, 2016 8:53 pm

I see you're using Gitlab, yeah I must say I really fell in love with it's CI and CD systems when I used it in the past. :D

Are the SDKs compatible with gcc 5.2.0 yet?

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby ESP_igrr » Wed Oct 26, 2016 1:13 am

We're doing tests to make sure there are no regressions when building with GCC 5.2. As soon as that is done, we'll make an announcement and update toolchain links.

andyn_ff
Posts: 18
Joined: Mon Jun 10, 2019 4:34 pm

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby andyn_ff » Mon Jun 10, 2019 4:51 pm

I'm looking at the containers provided by Espressif on docker hub. Can anybody clarify the difference between espressif/esp32-ci-env and espressif/esp32-toolchain?

sch0bert
Posts: 16
Joined: Thu Apr 11, 2019 9:58 pm

Re: Docker: Super easy compiling and flashing without installing the SDK and all the dependencies

Postby sch0bert » Fri Sep 06, 2019 10:06 pm

I don't know the difference between those 2. I will be great if the Espressif guys that uploaded these containers also publish the source code of what is inside.

My project make usage of ULP functionality and I don't know if any docker container published in dockerhub will work for me. Any idea?

Who is online

Users browsing this forum: MicroController and 128 guests