Repository navigation
Conversation
|
iff is a shorthand way of writing |
00aeffa to
e89052d
Compare
|
@phemer It is. Difference is different implementation. This implementation is based on what has been merged in runc. |
|
@rhvgoyal sorry, deleted comment as I saw you even commented over there. Didn't notice as I unsubscribed from it a while ago due to "+1" spam. |
|
We will need to bump up the version of runc in docker. |
|
@mrunalp What's the process for bumping runc version. For now I have just taken the relevant pieces from runc and put in first patch. |
|
@mrunalp ok, thanks. I will look into it. Possibly create a separate PR to pull in newer runc and rebase this PR on top of that. |
|
Definitely makes this a bit easier! |
|
Also, force pushing to the old PR would have been better... I think this is the 3rd implementation? It's really fragmented the conversation. |
|
@rhvgoyal I may be missing something, but by making |
|
Further explanation: assuming import (
"github.com/docker/docker/pkg/mount"
)
...
hostConfig.RootPropogation = mount.RSHARED
...Which from a non-linux/freebsd box, will translate to 0...or more to the point, mount flags are platform-specific which is why they're hidden behind |
|
@runcom Thanks for taking care of moving to newer libcontainer version. |
|
@cpuguy83 Last PR was created by @rootfs and I don't have rights to push to that. That's primary reason I created a separate PR. Also I wanted to keep other implementation around so that we could compare the two, if need be. But if you are particular about it, I can talk to @rootfs, give him my patch and ask him to force push. Do let me know. |
|
|
@peter-edge You make a very good point. So if client is running on non-linux system and daemon is running on a linux system then there is no easy way to ask daemon to run container with a particular propagation mode. I think I should change RootPropagation field in HostConfig to string and parse it on daemon and convert into integer. Will rework my patches. Thanks. |
e89052d to
5635344
Compare
|
@peter-edge Changed patches to keep RootPropagation in Hostconfig as string so that a non-linux based client can specify propagation mode for a linux based daemon. |
c968562 to
efa6eac
Compare
|
Is this going to be merged soon? There are a lot of people waiting on this, On Tuesday, October 13, 2015, Tibor Vass [email protected] wrote:
|
|
The single flag per container covers our use case as well. |
|
I am also looking forward to this change merging |
|
Ok, I generated another PR #17034 which allows specifying per volume mount propagation flags. PTAL. |
|
@rhvgoyal i was just asking a question, no need to open another PR ;) |
|
@crosbymichael I am just trying to make it as simple as possible. So I thought having two implementations will help in make a fair comparison. :-) |
|
I will personally buy a case of beer for whoever gets this the LGTM On Wednesday, October 14, 2015, Vivek Goyal [email protected]
|
|
@peter-edge my opensouce oath prevents me from accepting bribes ;) i'm reviewing this today anyways |
|
<3 On Wednesday, October 14, 2015, Michael Crosby [email protected]
|
|
Is there a way to add integration tests for this? |
|
@calavera I personally like --root-propagation better. So first thing is we need to have a consensus on the name and I can change it again, not a problem at all. I think adding integration tests should be doable. I had added couple of tests to runc. I will look into adding some tests here too. What are "completion" scripts? Also please have a look at other PR which introduces per volume propagation flag. I think that one is little more restrictive but is easier to understand. |
|
@rhvgoyal ./contrib/completion/... |
|
@rhvgoyal lets go with sorry for it changing on you. |
|
@crosbymichael ok, will change it to --root-mount-propagation. |
|
Yeesh @crosbymichael is a better typist then I am. |
Export parseOptions() so that docker code can convert propagation options [r]private, [r]slave and [r]shared to mount flag integers. Signed-off-by: Vivek Goyal <[email protected]>
Introduce a new optoin --mounts to specify mount propagation for /. This can be useful in getting shared/slave volumes inside container. For example: 1. To have slave volumes inside containers do following. docker run -ti -v /root/mnt-source:/root/mnt-dest --mounts=rslave fedora bash Note: This assumes that / on host is either "shared" or "slave". If it is not, convert it using "mount --make-slave /" 2. To have shared volumes inside container, do following. docker run -ti -v /root/mnt-source:/root/mnt-dest --mounts=shared --cap-add=SYS_ADMIN fedora bash Note: This assumes that "/" on host is shared. I have added SYS_ADMIN to container so that it can be allowed to do mounts inside container. Signed-off-by: Vivek Goyal <[email protected]>
6a5951d to
1c90a9f
Compare
Will look into writing integration tests now. |
|
I actually like the other patch better, but I am willing to take either. |
|
@rhvgoyal please, stop adding |
|
@rhatdan Now I am also little more inclined towards per volume propagation switch. That seems little easier to understand and will be little easy to explain to users. |
|
@calavera ok, will drop the |
|
@crosbymichael Fine with me. |
|
Ok, I will close this PR and let us track this in other PR #17034 where per volume propagation properties are specified. |
Recently runc patches got merged where one can specify per container / (root) propagation flags. Backport these patches in docker and add an option --root-propagation to allow per container root
propagation flags. Valid values are [r]private, [r]shared, [r]slave. These are useful when one wants certain volumes to be slave/shared inside containers.