diff --git a/ci/release-image/entrypoint.sh b/ci/release-image/entrypoint.sh index 460b559ba9cb..efe2f39d9bd9 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.