Skip to content

Cannot run in a rootless container using podman #76

@yanjiew1

Description

@yanjiew1

Describe the bug
The startup script in dev-variant container assumes that it is not run in a user namespace.
However, it is not true when using a rootless container. When it is run in a rootless container, uid 0 in the container will be mapped to the user who starts the container.

The startup script will try to create a user with uid 0 and the creation will fail with the error message.

useradd: UID 0 is not unique

To Reproduce
Run the dev container using podman as normal user:

podman run -it \
       -v "${HOME}":"${HOME}" -e EDK2_DOCKER_USER_HOME="${HOME}" \
       ghcr.io/tianocore/containers/ubuntu-20-dev:latest /bin/bash

Expected behavior
The container starts successfully and we can see the shell prompt.

Execution environment
Host OS: Ubuntu 22.04
Container Engine: podman version 4.5.0
Podman command run as normal user:

podman run -it \
       -v "${HOME}":"${HOME}" -e EDK2_DOCKER_USER_HOME="${HOME}" \
       ghcr.io/tianocore/containers/ubuntu-20-dev:latest /bin/bash

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions