From 27dbe998b10866c9643e40868a72ea09ebedc887 Mon Sep 17 00:00:00 2001 From: twi-devel Date: Thu, 22 Oct 2026 18:27:03 +0200 Subject: [PATCH] Fix Jenkins workspace permission issue - Add jenkins user to Dockerfile.ci and run as non-root - Remove '-u root:root' args from Jenkinsfile Docker agent - Build files will now be owned by jenkins user, allowing proper cleanup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Entire-Checkpoint: f545f3d8aa33 Signed-off-by: twi-devel --- Jenkinsfile | 1 - ci/Dockerfile.ci | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5e47c8f..1962e4f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,7 +3,6 @@ pipeline { docker { image 'lifemaps/ci-cpp:latest' reuseNode true - args '-u root:root' } } diff --git a/ci/Dockerfile.ci b/ci/Dockerfile.ci index 4f946cd..8b2f1a3 100644 --- a/ci/Dockerfile.ci +++ b/ci/Dockerfile.ci @@ -2,6 +2,10 @@ FROM ubuntu:26.04 ENV DEBIAN_FRONTEND=noninteractive +# Create jenkins user with same UID as host jenkins (typically 1000) +RUN groupadd -g 1000 jenkins && \ + useradd -u 1000 -g 1000 -m -s /bin/bash jenkins + RUN apt-get update && \ apt-get install -y --no-install-recommends \ python3 \ @@ -30,3 +34,6 @@ ENV QT_QPA_PLATFORM=offscreen RUN git config --global --add safe.directory "*" WORKDIR /workspace + +# Switch to non-root user +USER jenkins