From 058e2bbe4ff5119cab9e311df0a705d40dd8029a Mon Sep 17 00:00:00 2001 From: Nathan Nguyen Date: Thu, 19 Oct 2023 10:59:09 +1000 Subject: [PATCH] chore: make podman UID mapping behave similarly to docker Signed-off-by: Nathan Nguyen --- scripts/release_scripts/run_macaron.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/release_scripts/run_macaron.sh b/scripts/release_scripts/run_macaron.sh index c75343932..dec611e8b 100755 --- a/scripts/release_scripts/run_macaron.sh +++ b/scripts/release_scripts/run_macaron.sh @@ -405,8 +405,15 @@ if [[ -n ${MCN_DEBUG_ARGS:-} ]]; then exit 0 fi -docker run \ - --pull ${DOCKER_PULL} \ +# By default +# - docker maps the host user $UID to a user with the same $UID in the container. +# - podman maps the host user $UID to the root user in the container. +# To make podman behave similarly to docker, we need to set the following env var. +# Reference: https://docs.podman.io/en/v4.4/markdown/options/userns.container.html. +export PODMAN_USERNS=keep-id + +${DOCKER_EXEC} run \ + --pull "${DOCKER_PULL}" \ --network=host \ --rm -i "${tty[@]}" \ -e "USER_UID=${USER_UID}" \