-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Rootless podman in rootless podman reports outer container's PIDs #19440
Comments
nested podman is not able to mount a fresh |
Thanks for that information. The problem is that any process running in the inner container cannot use its own pid to get its own information, as the pid namespace is incorrect: e.g.
Could you please consider fixing this? |
that looks like a quoting issue, could you try:
|
Indeed there is a quoting issue. Thanks for pointing that out. However, after fixing the quotes, the test shows the outer container's command line (with the executable being podman), not the inner container's (with the executable being sh).
|
that is indeed an issue. We are bind mounting The mount for proc is specified in the I double checked and we must create a new PID namespace because we are not using cgroups inside the container, and the runtime requires either a PID namespace or a cgroup (otherwise there is no way to track the processes). I am not sure we can come out with a better default, since mounting a fresh proc requires a fully visible If you need to access proc in the nested container, you could create a variant of the podman image that doesn't bind mount FROM quay.io/podman/stable
RUN rm /home/podman/.config/containers/containers.conf and then run the outer container with a fully visible
|
I've found an easier way that doesn't require a new image:
|
The workaround works well. Thanks for that and the detailed explanation! If there is no better default that the official image could use, then perhaps the documentation (the podman image or rootless podman?) could be updated to mention this use case. Hopefully, the information could help save other people time in troubleshooting. |
Is there a way to pass this security-opt when using |
I am closing this issue since there is no better way for Podman to solve it, it requires a custom configuration for the outer container otherwise nested Podman cannot mount a fresh
I think there is no way at the moment, but this should be addressed using:
could you please file a new RFE issue requesting this feature? |
Issue Description
The inner container sees the outer container's process tree. The command is a modification of the "Rootless Podman running rootless Podman" example in https://www.redhat.com/sysadmin/podman-inside-container.
Steps to reproduce the issue
Steps to reproduce the issue
podman run --security-opt label=disable --user podman --device /dev/fuse quay.io/podman/stable podman run alpine ps
Describe the results you received
Describe the results you expected
Like using rootful podman, the inner container should see its own process tree only.
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
This is likely the result of the bind mount of
/proc
of the outer container into the inner container due to the~/.config/containers/containers.conf
shipped in quay.io/podman/stable.The text was updated successfully, but these errors were encountered: