-
Notifications
You must be signed in to change notification settings - Fork 554
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bind is not a valid mount type #967
Conversation
94dd6a9
to
06db44c
Compare
Per spec, "bind" is not a valid mount type. To use bind mount, the spec compatible way is to set either "bind" or "rbind" in the mount options. Although in practice, setting the type as "bind" won't actually cause an error (at the moment using runc, as well as the system call mount(7) itself) as long as either "bind" or "rbind" is set as well, it provide an incorrect example that "bind" is avalid type, and make people think following config is a valid one for bind mount, which in fact will throw an error in runc. { "destination": "/data", "type": "bind" "source": "/volumes/testing", } [1] tried to automatically add a MS_BIND flag when the type is "bind" but was rejected on the ground it "encourage" the incorrect usage of bind as the mount type, which I agree. Hence, here I change the example in the spec in the hope making it clearer that for bind mount to work, we should use the correct mount options, instead of the "bind" mount type. [1]opencontainers/runc#1799 Signed-off-by: Bin Chen <nk@devicu.com>
@@ -115,7 +115,6 @@ For POSIX platforms the `mounts` structure has the following fields: | |||
}, | |||
{ | |||
"destination": "/data", | |||
"type": "bind", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well change this to "type": "none"
to make this more clear it's not an accidental omission.
On Wed, 9 May 2018 at 6:17 pm, Aleksa Sarai ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In config.md
<#967 (comment)>
:
> @@ -115,7 +115,6 @@ For POSIX platforms the `mounts` structure has the following fields:
},
{
"destination": "/data",
- "type": "bind",
Might as well change this to "type": "none" to make this more clear it's
not an accidental omission.
Woo, I don't know "none" is a valid type. That's definitely better.
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#967 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAcNfg16Y_eqT-A9XcdlxAQB81bgs0X6ks5twqYMgaJpZM4T3wqO>
.
--
Chen Bin
|
Well, it's less that |
+1 |
- The 'source' of a bind mount can either be a file or a directory. - The 'type' field is a dummy in case of bind mounts, often left to "none" (in that case it does not have to be something listed in /proc/filesystems). - 'Relative' paths can only be used for bind mounts, not for other mounts. That's how runc manages this. Replaces: opencontainers#967 Signed-off-by: Alban Crequy <alban@kinvolk.io>
obsoleted by #981 |
Per spec, "bind" is not a valid mount type. To use bind mount,
the spec compatible way is to set either "bind" or "rbind"
in the mount options.
Although in practice, setting the type as "bind" won't actually
cause an error (at the moment using runc, as well as the system
call mount(7) itself) as long as either "bind" or "rbind" is set
as well, it provide an incorrect example that "bind" is avalid
type, and make people think following config is a valid one for
bind mount, which in fact will throw an error in runc.
{
"destination": "/data",
"type": "bind"
"source": "/volumes/testing",
}
[1] tried to automatically add a MS_BIND flag when the type is "bind"
but was rejected on the ground it "encourage" the incorrect usage of
bind as the mount type, which I agree. Hence, here I change the example
in the spec in the hope making it clearer that for bind mount to work,
we should use the correct mount options, instead of the "bind" mount type.
[1]opencontainers/runc#1799
Signed-off-by: Bin Chen <Bin Chen nk@devicu.com>