Open
Conversation
The current behavior disallows any mount have (r)shared on it because by default, the root is set with MS_SLAVE, 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. Signed-off-by: Evan Phoenix <evan@phx.io>
Contributor
Author
|
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. |
Member
|
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? |
Member
I guess @kolyshkin or @cyphar are the right persons to answer this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.