Skip to content

CI podman detection is not fully reliable #113129

Closed
@Noratrieb

Description

@Noratrieb

podman is (by design) not fully compatible with docker when it comes to user permissions. Therefore, ./src/ci/docker/run.sh needs to look behind the docker curtain to figure out whether it's actually podman and opt out of the user isolation.

rust/src/ci/docker/run.sh

Lines 219 to 226 in eb76764

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

With ubuntus docker podman compat package this works fine, because there docker --version prints something containing podman. But if you symlink docker to podman (something NixOS does if you set up docker-podman compat) then docker --version actually prints docker version 4.5.0. Podman outsmarts CI's detection.

I'm not sure about the ideal way to fix this, but docker system --help contains "manage podman" for me, so do whatever you want with this information.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustT-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions