|
|
|
|
|
by mikepurvis
1463 days ago
|
|
The other big piece is capabilities (specifically CAP_SYS_ADMIN) which as I understand it is related but kind of orthogonal to the question of root/rootless. For example, buildah (the container-building part of podman) is daemonless and can use the fuse-overlayfs storage driver to build containers rootlessly— you appear as root inside the container, but from the outside, those processes and any files created are owned by the original invoking user or some shim UID/GID based on a mapping table. But critically, this doesn't mean it's possible to just run buildah inside any Kubernetes pod and build a container there, because buildah needs to be able to start a user namespace, and must have the /dev/fuse device mapped in. I believe there continues to be ongoing work in this area (for example Linux 5.11 allows overlayfs in unprivileged containers), but the issue tracking [1] it is closed without really being IMO fully resolved, since the linked article [2] from July 2021 is still describing the different scenarios as distinct special cases that each require their own special sets of flags/settings/mounts/whatever. [1]: https://github.com/containers/buildah/issues/2554 [2]: https://www.redhat.com/sysadmin/podman-inside-kubernetes |
|
https://www.redhat.com/sysadmin/podman-inside-container
You can run "capsh --print" to see your current capabilities. And to run a container without any capabilities:
podman run --cap-drop ALL -it fedora capsh --print