mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Use --userns=keep-id
when "docker" is really podman
Rootless podman creates a separate user namespace, where an inner `LOCAL_USER_ID` will map to a different subuid range on the host. The "keep-id" mode maps the current UID directly into the container. This makes `src/ci/docker/run.sh` work better for testing container images on systems running podman, where "docker" is just a shim.
This commit is contained in:
parent
a1bea1551b
commit
4eb748bf39
@ -213,7 +213,16 @@ else
|
||||
args="$args --volume $HOME/.cargo:/cargo"
|
||||
args="$args --volume $HOME/rustsrc:$HOME/rustsrc"
|
||||
args="$args --volume /tmp/toolstate:/tmp/toolstate"
|
||||
args="$args --env LOCAL_USER_ID=`id -u`"
|
||||
|
||||
id=$(id -u)
|
||||
if [[ "$id" != 0 && "$(docker -v)" =~ ^podman ]]; then
|
||||
# Rootless podman creates a separate user namespace, where an inner
|
||||
# LOCAL_USER_ID will map to a different subuid range on the host.
|
||||
# The "keep-id" mode maps the current UID directly into the container.
|
||||
args="$args --env NO_CHANGE_USER=1 --userns=keep-id"
|
||||
else
|
||||
args="$args --env LOCAL_USER_ID=$id"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$dev" = "1" ]
|
||||
|
Loading…
Reference in New Issue
Block a user