Skip to content

Update docker container to debian bookworm and configure it on build - #27998

Merged
thinkyhead merged 3 commits into
MarlinFirmware:bugfix-2.1.xfrom
ThomasToka:DockerImageToBookworm
Oct 6, 2025
Merged

Update docker container to debian bookworm and configure it on build#27998
thinkyhead merged 3 commits into
MarlinFirmware:bugfix-2.1.xfrom
ThomasToka:DockerImageToBookworm

Conversation

@ThomasToka

@ThomasToka ThomasToka commented Aug 2, 2025

Copy link
Copy Markdown
Contributor

Description

While trying to run checks for pull requests on windows i struggled on getting it to work.

  • the included Dockerfile upstream atm is based on Debian buster which is EOL for some months.
  • a simple Os only update does not work as then libs are missing
  • this script can and should be run as a normal user. No more need to run it as root!

So i upgraded the Dockerfile and created a litte helper script to regenerate the Docker Container.

xxx@xxx:/mnt/c/Users/xxx/Documents/GitHub/Marlin$ ./build_docker_container.sh
[+] Building 2.6s (10/10) FINISHED                                                                                                                                                                                            docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 1.00kB                                                                                                                                                                                                  0.0s
 => [internal] load metadata for docker.io/library/python:3.11-bookworm                                                                                                                                                                 0.9s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => [1/6] FROM docker.io/library/python:3.11-bookworm@sha256:c1239cb82bf08176c4c90421ab425a1696257b098d9ce21e68de9319c255a47d                                                                                                           0.0s
 => => resolve docker.io/library/python:3.11-bookworm@sha256:c1239cb82bf08176c4c90421ab425a1696257b098d9ce21e68de9319c255a47d                                                                                                           0.0s
 => CACHED [2/6] RUN apt-get update && apt-get install -y     libsdl2-dev     libsdl2-net-dev     libgl1-mesa-dev     libegl1-mesa-dev     libglu1-mesa-dev     libx11-dev     libxext-dev     libxrandr-dev     libxinerama-dev     l  0.0s
 => CACHED [3/6] RUN pip install --upgrade pip                                                                                                                                                                                          0.0s
 => CACHED [4/6] RUN pip install -U platformio PyYaml                                                                                                                                                                                   0.0s
 => CACHED [5/6] RUN pio upgrade --dev                                                                                                                                                                                                  0.0s
 => [6/6] WORKDIR /code                                                                                                                                                                                                                 0.6s
 => exporting to image                                                                                                                                                                                                                  0.9s
 => => exporting layers                                                                                                                                                                                                                 0.7s
 => => exporting manifest sha256:f518ebd78dc50c6b320c511279b8cffd3cb1dc4ed8664e756a977569f577b27a                                                                                                                                       0.0s
 => => exporting config sha256:bf8e547f08058d7a8a0db58a4f1c947bffaf565f196855a449000af49483da25                                                                                                                                         0.0s
 => => exporting attestation manifest sha256:182ba389ade85d4c91e126740f128da8efad6903e4c82600f79514ffd9620f17                                                                                                                           0.0s
 => => exporting manifest list sha256:596b0c40f49f330f38792252dbc1f0fe51a5787abca5f7a5ce325d0fe5f8d714                                                                                                                                  0.0s
 => => naming to docker.io/library/marlin-dev:latest                                                                                                                                                                                    0.0s
 => => unpacking to docker.io/library/marlin-dev:latest                                                                                                                                                                                 0.0s
run all tests in the docker container:
make tests-all-local-docker
or a single test like:
make tests-single-local-docker TEST_TARGET=mega2560

Requirements

  • written for WSL on Windows
  • should also work on other linux
  • docker

Benefits

Local commit checks possible before a PR.

Configurations

Not needed.

Related Issues

none.

@ThomasToka ThomasToka changed the title Update docker container to debian bookworm and configure it build Update docker container to debian bookworm and configure it on build Aug 2, 2025
@ThomasToka

Copy link
Copy Markdown
Contributor Author

Additional info:

The checks itself seem to need some attention:

[Test mega1280] Spindle, MESH_BED_LEVELING, closed loop, Power Monitor, and LCD...
*** [Marlin/src/HAL/AVR/HAL.cpp] /code/.pio/build/mega1280/.sconsign311.dblite: No such file or directory
========================= [FAILED] Took 75.80 seconds =========================

Environment    Status    Duration
-------------  --------  ------------
mega1280       FAILED    00:01:15.803
==================== 1 failed, 0 succeeded in 00:01:15.803 ====================
Failed!

this checks against .pio, but should be .platformio if understand the output correctly.

@ellensp

ellensp commented Aug 3, 2025

Copy link
Copy Markdown
Contributor

That is a platformio issue. It needs to build the database before build is started
Just trying again in a few moments normally gets past it

@ThomasToka

ThomasToka commented Aug 3, 2025

Copy link
Copy Markdown
Contributor Author

Thx for the hint. Indeed:

Passed
All tests completed successfully

i will have a look if a small sleep or loop somewhere might help..

but well as i looked in the other code here i think the change to the marlin user in build environment would need more attention and other changes. so i will remove that part and let it be root.

Update Dockerfile to Debian Bookworm
Include needed libs for the simulator
@ThomasToka
ThomasToka force-pushed the DockerImageToBookworm branch from da7c4a1 to 9655939 Compare August 3, 2025 08:41
@thinkyhead

thinkyhead commented Sep 6, 2025

Copy link
Copy Markdown
Member

How does the setup script differ from the existing make setup-local-docker which runs docker buildx build -t marlin-dev -f docker/Dockerfile . ?

Comment thread Makefile
@thinkyhead thinkyhead added the T: Development Makefiles, PlatformIO, Python scripts, etc. label Sep 6, 2025
@thinkyhead
thinkyhead merged commit e43c275 into MarlinFirmware:bugfix-2.1.x Oct 6, 2025
67 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T: Development Makefiles, PlatformIO, Python scripts, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants