diff --git a/build/jenkins/dockerfiles/bullseye-base.Dockerfile b/build/jenkins/dockerfiles/bullseye-base.Dockerfile index b24d2544ae..af1f30c8ca 100644 --- a/build/jenkins/dockerfiles/bullseye-base.Dockerfile +++ b/build/jenkins/dockerfiles/bullseye-base.Dockerfile @@ -1,7 +1,5 @@ FROM debian:bullseye-slim -RUN useradd -ms /bin/bash --uid 1006 builder - # 0 A.D. dependencies. ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NOWARNINGS="yes" @@ -45,9 +43,7 @@ RUN apt-get -qqy update && apt-get install -qqy --no-install-recommends git-lfs RUN git lfs install --system --skip-smudge # Install rust and Cargo via rustup -USER builder RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.66.0 -y -ENV PATH="${PATH}:/home/builder/.cargo/bin" -USER root +ENV PATH="${PATH}:/root/.cargo/bin" ENV SHELL=/bin/bash diff --git a/build/jenkins/dockerfiles/buster-base.Dockerfile b/build/jenkins/dockerfiles/buster-base.Dockerfile index 08d15ab021..7e4be79799 100644 --- a/build/jenkins/dockerfiles/buster-base.Dockerfile +++ b/build/jenkins/dockerfiles/buster-base.Dockerfile @@ -1,7 +1,5 @@ FROM debian:buster-slim -RUN useradd -ms /bin/bash --uid 1006 builder - # 0 A.D. dependencies. ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NOWARNINGS="yes" @@ -47,10 +45,8 @@ RUN apt-get -qqy update && apt-get install -qqy --no-install-recommends git-lfs RUN git lfs install --system --skip-smudge # Install rust and Cargo via rustup -USER builder RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain 1.66.0 -y -ENV PATH="${PATH}:/home/builder/.cargo/bin" -USER root +ENV PATH="${PATH}:/root/.cargo/bin" ENV SHELL=/bin/bash diff --git a/build/jenkins/dockerfiles/clang9.Dockerfile b/build/jenkins/dockerfiles/clang9.Dockerfile index 09114313ed..ced84e2b93 100644 --- a/build/jenkins/dockerfiles/clang9.Dockerfile +++ b/build/jenkins/dockerfiles/clang9.Dockerfile @@ -4,8 +4,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NOWARNINGS="yes" RUN apt-get update && apt-get install -qqy llvm-9 clang-9 lld-9 libclang-9-dev --no-install-recommends -USER builder - ENV CC=clang-9 ENV CXX=clang++-9 ENV LDFLAGS="-fuse-ld=lld-9" diff --git a/build/jenkins/dockerfiles/gcc8.Dockerfile b/build/jenkins/dockerfiles/gcc8.Dockerfile index c296a965f4..c6538ea40a 100644 --- a/build/jenkins/dockerfiles/gcc8.Dockerfile +++ b/build/jenkins/dockerfiles/gcc8.Dockerfile @@ -4,8 +4,6 @@ ARG DEBIAN_FRONTEND=noninteractive ARG DEBCONF_NOWARNINGS="yes" RUN apt-get install -qqy gcc-8 g++-8 --no-install-recommends -USER builder - ENV LIBCC=gcc-8 ENV LIBCXX=g++-8 ENV CC=gcc-8 diff --git a/build/jenkins/pipelines/linux.Jenkinsfile b/build/jenkins/pipelines/linux.Jenkinsfile index a0a537158a..7e6e2f74e2 100644 --- a/build/jenkins/pipelines/linux.Jenkinsfile +++ b/build/jenkins/pipelines/linux.Jenkinsfile @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -57,6 +57,9 @@ pipeline { customWorkspace "workspace/${JENKINS_COMPILER}-pch" dir 'build/jenkins/dockerfiles' filename "${JENKINS_COMPILER}.Dockerfile" + // Prevent Jenkins from running commands with the UID of the host's jenkins user + // https://stackoverflow.com/a/42822143 + args '-u root' } } diff --git a/build/jenkins/pipelines/technical-docs.Jenkinsfile b/build/jenkins/pipelines/technical-docs.Jenkinsfile index 6585084460..f319afaaa9 100644 --- a/build/jenkins/pipelines/technical-docs.Jenkinsfile +++ b/build/jenkins/pipelines/technical-docs.Jenkinsfile @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -21,9 +21,12 @@ pipeline { agent { dockerfile { label 'LinuxAgent' - customWorkspace "workspace/technical-docs" + customWorkspace 'workspace/technical-docs' dir 'build/jenkins/dockerfiles' - filename "docs-tools.Dockerfile" + filename 'docs-tools.Dockerfile' + // Prevent Jenkins from running commands with the UID of the host's jenkins user + // https://stackoverflow.com/a/42822143 + args '-u root' } }