Skip to content

Commit 06db44c

Browse files
binchenXBin Chen
authored andcommitted
bind is not a valid mount type
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>
1 parent a1998ec commit 06db44c

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

config.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ For POSIX platforms the `mounts` structure has the following fields:
115115
},
116116
{
117117
"destination": "/data",
118-
"type": "bind",
119118
"source": "/volumes/testing",
120119
"options": ["rbind","rw"]
121120
}

0 commit comments

Comments
 (0)