[GUI Docker] Missing mount propagation "shared" option for --volume


4 posts in this topic Last Reply

Recommended Posts

When mounting volumes in docker, we're missing some propagation options ("Access Mode") for the mounted volumes. They are not well documented on the official docker documentation, but some more information can be found here.

 

Currently we can do: RW, RW/Slave, RO, RO/Slave

 

Default is private, we can specify slave but we're missing the "shared" option so we can do 

-v /mnt/disks/acd_volume/:/data:shared

Current work around is just to use the "Extra Parameters".

 

Here some more information regarding the propagation options (c/p from manpages):

By default bind mounted volumes are private. That means any mounts done inside container will not be visible on host and vice-a-versa. One can change this behavior by specifying a volume mount propagation property. Making a volume shared mounts done under that volume inside container will be visible on host and vice-a-versa. Making a volume slave enables only one way mount propagation and that is mounts done on host under that volume will be visible inside container but not the other way around.

 

To control mount propagation property of volume one can use :[r]shared, :[r]slave or :[r]private propagation flag. Propagation property can be specified only for bind mounted volumes and not for internal volumes or named volumes. For mount propagation to work source mount point (mount point where source dir is mounted on) has to have right propagation properties. For shared volumes, source mount point has to be shared. And for slave volumes, source mount has to be either shared or slave.

 

Use df <source-dir> to figure out the source mount and then use findmnt -o TARGET,PROPAGATION <source-mount-dir> to figure out propagation properties of source mount. If findmnt utility is not available, then one can look at mount entry for source mount point in /proc/self/mountinfo. Look at optional fields and see if any propagaion properties are specified. shared:X means mount is shared, master:X means mount is slave and if nothing is there that means mount is private.

Link to post
  • 1 month later...
2 hours ago, thomast_88 said:

Any update on this? Should be fairly easy to add, as it just a different argument to the docker run command :-)

 

I have added the "shared" option, should become available in the next release.

 

Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.