Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Change mount point propogation to default to slave - #520

Merged
crosbymichael merged 1 commit into
docker-archive:masterfrom
rhatdan:slave
Apr 10, 2015
Merged

crosbymichael merged 1 commit into
docker-archive:masterfrom
rhatdan:slave

Conversation

@rhatdan

@rhatdan rhatdan commented Apr 10, 2015

Copy link
Copy Markdown
Contributor

As an admin I would expect that if I volume mount a partition into a container, and then later add a mount point to the volume, it will show up in the container.

Docker-DCO-1.1-Signed-off-by: Dan Walsh [email protected] (github: rhatdan)

As an admin I would expect that if I volume mount a partition into a container, and then later add a mount point to the volume, it will show up in the container.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
@rhatdan

rhatdan commented Apr 10, 2015

Copy link
Copy Markdown
Contributor Author

We need this change to allow autofs from the host to work. Is there a good reason to choose PRIVATE over SLAVE?

@ibuildthecloud

Copy link
Copy Markdown

+1

@crosbymichael

Copy link
Copy Markdown
Contributor

@alexlarsson Can you remember the reason why we defaulted to MS_PRIVATE?

@ibuildthecloud

Copy link
Copy Markdown

@crosbymichael I thought some of this had to do with the fact that by default the host mount namespace will not see the container mounts. So the host mount namespace doesn't get polluted

@ibuildthecloud

Copy link
Copy Markdown

@rhatdan Doesn't something need to change here too https://github.com/rhatdan/libcontainer/blob/slave/rootfs_linux.go#L133

By default the bind mounts are private, are you expecting those bind mounts to be SLAVE also?

@rhatdan

rhatdan commented Apr 10, 2015

Copy link
Copy Markdown
Contributor Author

@ibuildthecloud With slave the hosts mnt namespace does not see the containers, but the container can see changes to the host if the hosts volume mounted into the container.

@ibuildthecloud The bind mounts are the ones passed in as being private, I believe.

I tested this out with a docker run -v /usr:/usr fedora /bin/sh,
Then mounted a directory on /usr/share/test, and the container could see the contents.

@ibuildthecloud

Copy link
Copy Markdown

@rhatdan thanks, let me test this

@crosbymichael

Copy link
Copy Markdown
Contributor

LGTM

@ibuildthecloud

Copy link
Copy Markdown

All my tests are good. This patch has minimal impact if your host mounts are set to MS_PRIVATE.

@mrunalp

mrunalp commented Apr 10, 2015

Copy link
Copy Markdown
Contributor

LGTM

crosbymichael added a commit that referenced this pull request Apr 10, 2015
Change mount point propogation to default to slave
@crosbymichael
crosbymichael merged commit 883cbf7 into docker-archive:master Apr 10, 2015
@jeremyeder

Copy link
Copy Markdown

Cool, only 10 days late :-) @rhatdan asked us to test this; we found no change in container create/destroy performance between docker-1.5 and docker-1.6.

@mrunalp

mrunalp commented Apr 20, 2015

Copy link
Copy Markdown
Contributor

@jeremyeder Good to know :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants