Simple Docker image for building with platformio
  • Shell 55.9%
  • Dockerfile 23.1%
  • Makefile 21%
Find a file
Trey Turner c13403d9eb feat: include PlatformIO version in image tags
- Dockerfile: add ARG PLATFORMIO_VERSION, pin pip install when provided
- action: add build-args input passthrough
- Makefile: detect version from PyPI lazily in recipe, pass as build arg
- build-and-publish-dev: detect version, tag as v<ver>-dev, add major/minor dev tags
- promote-tag: require version input, promote v<ver>-dev to versioned release tags
- README: document tag scheme, version pinning, and publishing workflow

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 03:56:04 -05:00
.github feat: include PlatformIO version in image tags 2026-03-25 03:56:04 -05:00
src fix(entrypoint): chown dirs (#1) 2026-03-22 14:06:55 -05:00
Dockerfile feat: include PlatformIO version in image tags 2026-03-25 03:56:04 -05:00
LICENSE Initial commit 2026-01-22 16:07:54 -06:00
Makefile feat: include PlatformIO version in image tags 2026-03-25 03:56:04 -05:00
README.md feat: include PlatformIO version in image tags 2026-03-25 03:56:04 -05:00
with_builder.sh feat: migrate from forgejo to github (#1) 2026-03-21 02:54:17 -05:00

platformio-builder

Simple Docker image for building with PlatformIO.

Image tags

  • v<version>-dev — built from main, e.g. v6.1.19-dev
  • v<version> — promoted release, e.g. v6.1.19
  • latest — most recently promoted release

Usage

General

  • Pass PUID and PGID at runtime (or use the wrapper) to match the host user. Defaults (1001:121) align with GitHub Actions.
  • Clone some source code
  • Mount source inside container as /work
  • (Optional) Persist caches through named or host-mounted volumes:
    • PlatformIO at /home/pio/.platformio
    • Builder (npm) cache at /home/pio/.platformio-builder
  • Run one-off pio builds/commands via ephemeral containers or bash to get an interactive shell and mess about

Direct usage

$ git clone https://github.com/MoonModules/WLED-MM.git
$ export PIO_BUILDER_CACHE_KEY="$(basename "$PWD")"
$ docker run --rm $([ -t 0 ] && echo '-t') $([[ "$-" =~ 'i' ]] && echo '-i') \
  --pull always \
  -e PUID="$(id -u)" \
  -e PGID="$(id -g)" \
  -v "$HOME/.platformio:/home/pio/.platformio" \
  -v "$HOME/.platformio-builder/$PIO_BUILDER_CACHE_KEY:/home/pio/.platformio-builder" \
  -v "$HOME/.platformio-builder/$PIO_BUILDER_CACHE_KEY/node_modules:/work/node_modules" \
  -v "${GITHUB_WORKSPACE:-$PWD}/WLED-MM:/work" \
  -w /work \
  ghcr.io/treyturner/platformio-builder:latest \
  pio --version

PlatformIO Core, version 6.1.19

Wrapper script

A wrapper with the above logic can be tweaked to your needs. Set PIO_BUILDER_TAG to pin a specific version:

PIO_BUILDER_TAG=v6.1.19 ./with_builder.sh pio run

Building

Build locally (queries PyPI for the latest PlatformIO version):

make build

Pin a specific PlatformIO version:

PLATFORMIO_VERSION=6.1.19 make build

Publishing

CI (automatic)

Pushing to main triggers the Build and publish dev workflow, which detects the latest PlatformIO version from PyPI and publishes a v<version>-dev image.

To build with a specific PlatformIO version, trigger the workflow manually and supply the platformio_version input.

Promoting to a release tag

Run the Promote dev version tag to release version tag workflow with:

Input Description
platformio_version Version to promote, e.g. 6.1.19
latest If enabled, also retag the image as latest

This promotes v<version>-devv<version> (and optionally latest).