-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Podman requires --userns=keep-id to avoid AccessDeniedExceptions while building the native image #3625
Conversation
…e building the native image According to the podman documentation: --userns=keep-id: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container. Updating to `container-selinux-2.115.0-1.gitfddfbbb` is also required to avoid disabling SELinux (Cannot restore segment prot after reloc: Permission denied). More information: containers/podman#3859
@gastaldi do you see someone with Podman experience who could review it? I can approve it but I have no idea if it's the right fix or not :). |
@rhatdan perhaps you could review this? Thanks |
Basically this would mean the container will run as the UID of the user who runs it, meaning any content created will be owned by that user when run as rootless podman. I would change the check, to check if the command is being run by non root then if doing podman execute the --keep option. Otherwise use the --user option. |
Hm, even if the user is root, using the |
The following code seems to be attempting to run the container with a specifc User
Docker and Podman started as root would want to run with this user correct? Podman run by that user would stay as that user. |
AFAIK that code uses the effective user and group IDs from the process that runs the Maven plugin (it runs a |
Ok, so if this is always running as the user, then yes this Patch LGTM. With the change to Podman you no longer require access to the docker.sock, which would hugely increase security. Since I believe access to the docker.sock is the most dangerous thing you can do on Linux. More dangerous then giving the user sudo root without password. https://www.projectatomic.io/blog/2014/09/granting-rights-to-users-to-use-docker-in-fedora/ |
According to the podman documentation:
--userns=keep-id: creates a user namespace where the current rootless user's UID:GID are mapped to the same values in the container.
Updating to
container-selinux-2.115.0-1.gitfddfbbb
is also required to avoid disabling SELinux (Cannot restore segment prot after reloc: Permission denied).More information: containers/podman#3859