From d37a3f2e7542b049015a8b81e297d47aec71bd26 Mon Sep 17 00:00:00 2001 From: Bin Chen Date: Wed, 9 May 2018 16:00:15 +1000 Subject: [PATCH] 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]https://github.com/opencontainers/runc/pull/1799 Signed-off-by: Bin Chen --- config.md | 1 - 1 file changed, 1 deletion(-) diff --git a/config.md b/config.md index 2d9279fb1..cc3fcf57c 100644 --- a/config.md +++ b/config.md @@ -115,7 +115,6 @@ For POSIX platforms the `mounts` structure has the following fields: }, { "destination": "/data", - "type": "bind", "source": "/volumes/testing", "options": ["rbind","rw"] }