-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Provide capability of mount propagation between host and container #207
Comments
@mrunalp CC |
@rhatdan CC |
@rootfs CC |
Docker PR can be found at moby/moby#15648 |
In container slave mode, one can bind mount a directory from host into container and destination mount in container will become a "slave", if source mount is "shared". Now if anything is mounted One can find source mount of a directory using "df " command. And one can find propagation properties of a mount using "findmnt -o TARGET,PROPAGATION " command. Example: Say, one wants to mount /root/mnt-source directory inside container at /root/mnt-dest. Do following.
$ runc
$ findmnt -o TARGET,PROPAGATION /root/mnt-dest
$ mkdir /root/mnt-source/mnt1
|
In container_shared mode, one can bind mount a directory from host into container and destination mount in container will become "shared", if source mount is "shared" and it is not source mount of container rootfs. Now if anything is mounted on host in source directory, it will become visible in container too. And if anything is mounted in container under "shared" mount, it will become visible on host. One can find source mount of a directory using "df " command. And one can find propagation properties of a mount using "findmnt -o TARGET,PROPAGATION " command. Example: Say, one wants to mount /root/mnt-source directory inside container at /root/mnt-dest. Do following.
$ mkdir /root/mnt-source
"linux": {
$ runc
$ findmnt -o TARGET,PROPAGATION /root/mnt-dest
|
This was merged and is working now |
Currently container / is marked RPRIVATE. That means once the container starts, any mount on host is not visible in container and vice-a-versa.
People have been looking for capabilities where these restrictions can be relaxed and some kind of mount propagation can take place after container has started. There are two primary use cases.
Define new rootfsPropagation modes where user can opt in for new propagation mode.
The text was updated successfully, but these errors were encountered: