Docker Container for STM32 CMake & Ninja Compiling

Visit GitHub for source code.

-+- TL;DR -+-

This docker image auto clone an online git repo and compile the CMake & Ninja supported STM32 project locally on your computer with mounted volume.

docker run -v "{HostEmptyPath}":"/app" jasonyangee/stm32-builder:ubuntu-latest -r {Git_Repo_URL}

Example Project

For CMake setup, refer to the below STM32 project template.

https://github.com/jasonyang-ee/STM32-CMAKE-TEMPLATE.git

Help Menu

docker run jasonyangee/stm32-builder:ubuntu-latest --help                              
Usage: build.sh [OPTIONS]
Options:
 -h, --help                            Print this help message
 -t, --type <build type>               CMake build type -- Default: Release
 -r, --repo <repository url>           Clone repository from url and build

Commands:

docker run -v {HostPath}:/app {IMAGE:VERSION} -r {Git_Repo_URL} -t {Build_Type}

Basics of This Image

This image is intended for building STM32 Microcontroller C/C++ Project Configured with CMake and Ninja.

The entrypoint bash script executes basically those commands in default:

git clone $REPO $VOLUME
cmake -DCMAKE_BUILD_TYPE=$TYPE -S $VOLUME -B $VOLUME/build/ -G Ninja
cmake --build $VOLUME/build/ -j$CORES

Docker Image Compiler Environment

Public Registry:

ghcr.io/jasonyang-ee/stm32-builder:ubuntu-latest

ghcr.io/jasonyang-ee/stm32-builder:debian-latest

ghcr.io/jasonyang-ee/stm32-builder:alpine-latest

ghcr.io/jasonyang-ee/stm32-builder:arch-latest

jasonyangee/stm32-builder:ubuntu-latest

jasonyangee/stm32-builder:debian-latest

jasonyangee/stm32-builder:alpine-latest

jasonyangee/stm32-builder:arch-latest