Replies: 1 comment 2 replies
-
Have you read https://www.redhat.com/en/blog/podman-inside-container? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
running
podman-5.2.3-1.fc40.x86_64
I'm experimenting with running podman inside podman (withquay.io/podman/stable
image) in different setups among(rootful, rootless) x (--privileged, no --privileged) x (rootful, rootless)
and the deeper I dig the more I'm confused.So far, my understanding is that, as for the general principles:
rootless
always uses a usernamespacerootful
orrootless
)podman
tries to use nativeoverlayfs
mount (I'm not sure if it falls back tofuse-overlayfs
)cap_sys_admin
which it drops after the mount except when--privileged
is usedrootful
container, in general, does not use a usernamepace, so a sub-container would have to have its "host" container ran with--privileged
in order to keep this cap whether arootless
one would be able to fresh start with all (namespaced) capsI can see that the above podman image comes with a
podman
user with the followingsubuids
(same forsubgids
) :I guess the first range is to be able to map to those uids which exists in the host container. I'm not really sure what the second one is intended for (maybe just have more uids) ?
I gave my own user the following subuids/subgids:
So, here's what I tested:
rootful
from global usernamespace : no usernamespace created, with or without--privileged
(seems normal to me)rootful
container from insiderootful
containera) without
--privileged
: it seems it can neither use native mount (which is expected as stated above) but nor can it use fuse-overlayfs : is this because this requires a kernel module and only--privileged
allows a container to use a module ?b) with
--privileged
: this works, no usernamespace created (as expected)rootful
container from insiderootless
containera) without
--privileged
:I don't get this one : it seems
podman
wants to create another usernamespace and map theroot
user ? (which of course has nosubuids
)-> what is happening here ?
b) with
--privileged
: it works and therootful
container stays in the same usernamespace as the one created by itsrootless
host (seems expected to me)rootless
container from global usernamespaceNothing special here
rootless
container fromrootful
containerI'm issuing from inside the
rootless
containersu - podman
:I'm not sure about the above warning (I guess it is because a new mnt namespace is created ?)
But I don't get what I see then (which happens in
rootless
fromrootless
too):Why is the shell not mapped but
cat
is ?Why
ls
can read its usernamespace (which I can confirm is different from the global one) and not the shell ?I get similar results with
--privileged
as wellFinally, I've read that for rootless subcontainer (using this image) I should run
podman run --user podman
, but I don't get the idea as my understanding is this instruct to run the container cmd/process with the internalpodman
user but what I want for running therootless
inner container is the externalpodman
user (the one inside the outer image, which will maps the inner uids to is outer subuids) ? Or maybe it was meant to act as mysu - podman
from the outside ?Can you help me figuring out what's going on and/or what I should or shouldn't do to run in those different scenarii podmain inside podman ?
Thanks for your help
--
Thomas HUMMEL
Beta Was this translation helpful? Give feedback.
All reactions