Skip to content

Latest commit

 

History

99 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-stm32-cmake

Build Docker Pulls Docker Image Size Docker Image Version GitHub Stars License: MIT

docker-stm32-cmake STM32CubeCLT Version Build Status
VersionStatus
v1.21.0available
v1.20.0available
v1.19.0available
v1.18.0available
v1.17.0available
v1.16.0available
📋 See all versions →

A Docker image providing a headless CI/CD environment for STM32CubeCLT (STMicroelectronics Command Line Tools). Each image ships with STM32CubeCLT pre-installed — ready to use immediately with no runtime installation required.

Note: STM32CubeCLT is fully installed during the Docker build process. The container starts instantly with all tools ready to use.

Usage

Once the container is running, use CLI commands to build and program your STM32 projects.

Build with CMake:

docker run -it -v $(pwd):/workspace uoohyo/stm32-cmake:latest bash -c "
  cd /workspace/your-project
  mkdir -p build && cd build
  cmake .. -G Ninja
  ninja
"

Compile with Make:

docker run -it -v $(pwd):/workspace uoohyo/stm32-cmake:latest bash -c "
  cd /workspace/your-project
  make
"

Generate code with STM32CubeMX:

docker run -it -v $(pwd):/workspace uoohyo/stm32-cmake:latest bash -c "
  cd /workspace
  STM32CubeMX -q your-project.ioc
"

Program STM32 device:

docker run -it --privileged -v /dev/bus/usb:/dev/bus/usb \
  -v $(pwd):/workspace uoohyo/stm32-cmake:latest bash -c "
  STM32_Programmer_CLI -c port=SWD -w firmware.hex -v -rst
"

Quick Start

Pull a version-specific image from Docker Hub:

docker pull uoohyo/stm32-cmake:1.16.0

Or use the latest:

docker pull uoohyo/stm32-cmake:latest

Run the container:

docker run -it -v $(pwd):/workspace uoohyo/stm32-cmake:1.16.0

See docs/versions.md for all available versions.

Building Locally

This project uses a two-step build process where the STM32CubeCLT installer is downloaded by GitHub Actions before Docker build.

For local builds, you need to download the installer manually:

  1. Download STM32CubeCLT from st.com (requires free ST account)

  2. Place the .zip file in cubeclt_download/ directory

  3. Build the image:

    mkdir -p cubeclt_download
    # Place your downloaded .zip file in cubeclt_download/
    docker build --build-arg CUBECLT_VERSION="1.16.0" -t stm32-cmake:local .
    

Included Tools

Component Description
STM32CubeMX STM32 initialization code generator
STM32CubeProgrammer STM32 programming and debugging tool
GNU ARM Toolchain arm-none-eabi-gcc for ARM Cortex-M compilation
CMake Build system generator
Ninja Fast build system
Git Version control

CI/CD Integration

GitHub Actions:

name: Build STM32 Firmware
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    container:
      image: uoohyo/stm32-cmake:latest
    steps:
      - uses: actions/checkout@v4
      - name: Build
        run: |
          mkdir -p build && cd build
          cmake .. -G Ninja && ninja

GitLab CI:

build:
  image: uoohyo/stm32-cmake:latest
  script:
    - mkdir -p build && cd build
    - cmake .. -G Ninja && ninja

License

MIT License

Copyright (c) 2026 uoohyo

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

STM32CubeCLT with CMake and GNU ARM toolchain for STM32 development

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Contributors

Languages