From cf3d22362b6d780a8c50db07259eb333b79fe733 Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Fri, 1 Nov 2024 10:44:30 -0500 Subject: [PATCH] Set PODMAN_USERNS=keep-id when invoking 'docker run' (#1069) I missed the RPM release jobs when I made this change everywhere else in ros_buildfarm. Follow-up to d6df50a3429bc2725b95b6f16a92215a91b7ed59 --- ros_buildfarm/templates/release/rpm/binarypkg_job.xml.em | 2 ++ ros_buildfarm/templates/release/rpm/sourcepkg_job.xml.em | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ros_buildfarm/templates/release/rpm/binarypkg_job.xml.em b/ros_buildfarm/templates/release/rpm/binarypkg_job.xml.em index 573da5971..8fff5ac3c 100644 --- a/ros_buildfarm/templates/release/rpm/binarypkg_job.xml.em +++ b/ros_buildfarm/templates/release/rpm/binarypkg_job.xml.em @@ -130,6 +130,8 @@ but disabled since the package is blacklisted (or not whitelisted) in the config ] + ([ 'if [ ! -d "$HOME/.ccache" ]; then mkdir $HOME/.ccache; fi', ] if shared_ccache else []) + [ + '# If using Podman, change the user namespace to preserve UID. No effect if using Docker.', + 'export PODMAN_USERNS=keep-id', 'docker run' + ' --rm' + ' --privileged' + diff --git a/ros_buildfarm/templates/release/rpm/sourcepkg_job.xml.em b/ros_buildfarm/templates/release/rpm/sourcepkg_job.xml.em index 8f3e00acc..a91a89908 100644 --- a/ros_buildfarm/templates/release/rpm/sourcepkg_job.xml.em +++ b/ros_buildfarm/templates/release/rpm/sourcepkg_job.xml.em @@ -110,6 +110,8 @@ but disabled since the package is blacklisted (or not whitelisted) in the config 'echo "# BEGIN SECTION: Run Dockerfile - generate sourcerpm"', 'rm -fr $WORKSPACE/sourcepkg', 'mkdir -p $WORKSPACE/sourcepkg', + '# If using Podman, change the user namespace to preserve UID. No effect if using Docker.', + 'export PODMAN_USERNS=keep-id', 'docker run' + ' --rm' + ' --privileged' +