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

NopItTwice
Posts: 8
Joined: Thu Sep 22, 2016 2:30 am

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

Postby NopItTwice » Tue Oct 25, 2016 3:52 am

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 pretty much any system.
So I created two docker images: One for the "ESP8266 and ESP8266EX" and one for the "ESP32 and ESP31b".
If you are interested check it out on Github: https://github.com/T-vK/docker-esp-sdk

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

Code: Select all

git clone https://github.com/T-vK/docker-esp-sdk.git
cd docker-esp-sdk
sudo docker build -t tavk/esp-sdk:0.1.0 .


Usage is super simple:

Compiling binaries

Code: Select all

sudo docker run -t -i -u esp \
-v /home/ubuntu/esp8266/esp-open-sdk/examples/blinky:/home/esp/shared_project \
-e SDK_VERSION='1.5.3' \
tavk/esp-sdk:0.1.0 \
make


Flashing binaries

Code: Select all

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/ubuntu/esp8266/esp-open-sdk/examples/blinky:/home/esp/shared_project \
tavk/esp-sdk:0.1.0 \
esptool.py --port /dev/ttyUSB0 write_flash 0x00000 blinky-0x00000.bin 0x40000 blinky-0x40000.bin


Flashing bootloaders

Code: Select all

sudo docker run -t -i -u esp \
--device=/dev/ttyUSB0 \
-v /home/ubuntu/projects/esp-bootloader:/home/esp/shared_project \
tavk/esp-sdk:0.1.0 \
esptool.py --port /dev/ttyUSB0 write_flash --flash_mode dio --flash_size 32m 0x0 bootloader.bin


More detailed info on Github:
https://github.com/T-vK/docker-esp-sdk

electronicsguy
Posts: 7
Joined: Mon Jun 22, 2015 1:10 pm

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

Postby electronicsguy » Tue Jan 31, 2017 9:49 pm

If I only do development on my own Linux machine, is there still any advantage of using Docker over locally installing the tool-chain?

Who is online

Users browsing this forum: Google [Bot] and 12 guests