I use Docker for building MBED projects with the GCC toolchain. This is my Dockerfile:
There are a few arguments to change how it builds:
- mbed_requirements_url: this should point to the requirements.txt file in the mbed-os repository
- toolchain_url: should point to the toolchain tar.bz2 resource
- toolchain_name: the name of the directory that will unpack from tar.bz2 resource