From dd2e9fce277ff4f8699d9b4d9b41526943385e17 Mon Sep 17 00:00:00 2001 From: xfl12345 <17960863+xfl12345@users.noreply.github.com> Date: Sat, 19 Oct 2024 06:57:08 +0800 Subject: [PATCH] Fix user rename when restarting container (#7012) --- ci/release-image/entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/release-image/entrypoint.sh b/ci/release-image/entrypoint.sh index 460b559ba..efe2f39d9 100755 --- a/ci/release-image/entrypoint.sh +++ b/ci/release-image/entrypoint.sh @@ -7,7 +7,7 @@ eval "$(fixuid -q)" if [ "${DOCKER_USER-}" ]; then USER="$DOCKER_USER" - if [ "$DOCKER_USER" != "$(whoami)" ]; then + if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then echo "$DOCKER_USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/nopasswd > /dev/null # Unfortunately we cannot change $HOME as we cannot move any bind mounts # nor can we bind mount $HOME into a new home as that requires a privileged container.