How to share a volume between 2 podman rootless containers when using userns=auto #28438
DavyLandman
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As far as I've read,
userns=autocombined with rootless containers is the best isolation (although some discussion says that rootfull +userns=automight be even better, and the same issue holds there as well).I think I've identified 2 issues with
userns=autoand volumes:But sometimes you have to share some files between containers. For example share a unix socket between 2 containers. Or for example a caddy/nginx and a application that only runs the cgi and leaves the file serving up to the webserver.
For issue 1 I've found the following 2 fixes:
:Umodifier on the mount, but that does have the effect of causing achownon all the files in the mounted volume, which can cause quite a delay (and possible hurt snapshot based backups on systems like btrfs)For issue 2 I've only found fixes that suggest variants of: "don't use
userns=auto" or "useuserns=container:<other-container>". Is that correct, is there no way to set this up in a way that allows to isolate the two containers, while still allowing them to share a same volume?Maybe this could be an interesting blogpost? I've read quite a few, but this one seems to be hinted at only subtly.
Beta Was this translation helpful? Give feedback.
All reactions