- Notifications
You must be signed in to change notification settings - Fork2.2k
Allow shared mounts by default#4652
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
The current behavior disallows any mount have (r)shared on it because bydefault, the root is set with MS_SLAVE, which disallows sub-dirs fromhaving a different propagation.Projects have been working around this by setting the RootfsPropogationto "shared", to override the default(https://github.com/containerd/nerdctl/blob/main/pkg/mountutil/mountutil_linux.go#L185-L193).This patch makes a reasonable attempt to make the functionality workwithout touching RootfsPropogation.Signed-off-by: Evan Phoenix <evan@phx.io>
evanphx commentedFeb 28, 2025
Looking at the code I've edited, the code resets it to PRIVATE below. Can someone chime in on what the code setting to SLAVE is meant to do? Totally likely my change isn't right because I'm not sure I understand what the purpose is of setting SLAVE is. |
rata commentedApr 2, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Just curious, why not set the propagation you want for the rootfs in the config.json, as nerdctl is doing in the link you point? |
rata commentedApr 2, 2025
I guess@kolyshkin or@cyphar are the right persons to answer this |
Uh oh!
There was an error while loading.Please reload this page.
The current behavior disallows any mount having (r)shared on it because by default, the root is set with MS_SLAVE|MS_REC, which disallows sub-dirs from having a different propagation.
Projects have been working around this by setting the RootfsPropogation to "shared", to override the default
(https://github.com/containerd/nerdctl/blob/main/pkg/mountutil/mountutil_linux.go#L185-L193).
This patch makes a reasonable attempt to make the functionality work without touching RootfsPropogation.