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