From e43c2752c767e9ff724ee66e003d737ec075030f Mon Sep 17 00:00:00 2001 From: ThomasToka <117008525+ThomasToka@users.noreply.github.com> Date: Mon, 6 Oct 2025 21:36:36 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20Update=20Do?= =?UTF-8?q?cker=20setup=20(#27998)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 21 ++++++++++++++++++++- docker/Dockerfile | 18 +++++++++++++++++- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f1f64e1342..3cf29e54b3 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ help: @echo "make unit-test-single-local-docker : Run unit tests for a single config locally, using docker" @echo "make unit-test-all-local : Run all code tests locally" @echo "make unit-test-all-local-docker : Run all code tests locally, using docker" - @echo "make setup-local-docker : Setup local docker using buildx" + @echo "make setup-local-docker : Setup local docker" @echo "" @echo "Options for testing:" @echo " TEST_TARGET Set when running tests-single-*, to select the" @@ -88,7 +88,26 @@ unit-test-all-local-docker: @if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi $(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) make unit-test-all-local +USERNAME := $(shell whoami) +USER_ID := $(shell id -u) +GROUP_ID := $(shell id -g) + +.PHONY: setup-local-docker setup-local-docker-old + setup-local-docker: + @echo "Building marlin-dev Docker image..." + $(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) \ + --build-arg USERNAME=$(USERNAME) \ + --build-arg USER_ID=$(USER_ID) \ + --build-arg GROUP_ID=$(GROUP_ID) \ + -f docker/Dockerfile . + @echo + @echo "To run all tests in Docker:" + @echo " make tests-all-local-docker" + @echo "To run a single test in Docker:" + @echo " make tests-single-local-docker TEST_TARGET=mega2560" + +setup-local-docker-old: $(CONTAINER_RT_BIN) buildx build -t $(CONTAINER_IMAGE) -f docker/Dockerfile . PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h') diff --git a/docker/Dockerfile b/docker/Dockerfile index c01ca76ebb..6ac4e4932c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,20 @@ -FROM python:3.9.0-buster +FROM python:3.11-bookworm + +# Install build dependencies for simulator UI +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 \ + libxcursor-dev \ + libxi-dev \ + libglm-dev \ + && rm -rf /var/lib/apt/lists/* # Disable warnings about not having a TTY ARG DEBIAN_FRONTEND=noninteractive