Skip to content

Instantly share code, notes, and snippets.

@apatil
Created May 12, 2014 20:03
Show Gist options
  • Save apatil/930cd0e0bf037086a51f to your computer and use it in GitHub Desktop.
Save apatil/930cd0e0bf037086a51f to your computer and use it in GitHub Desktop.
CoreOS/Docker mount propagation tests
# Test 1:
# Launch data-only container in privileged mode
sudo docker run -i -t --name dataonly --privileged -v /shared ubuntu:14.04 /bin/bash
# in container:
mdir /shared/usr
mount --bind /usr /shared/usr
# Launch client container and attempt to read data from data-only container
sudo docker run -i -t --volumes-from dataonly ubuntu:14.04 /bin/bash
ls /shared/usr
# empty
@apatil
Copy link
Author

apatil commented May 12, 2014

Test 3: With gluster

# First container
sudo docker run -i -t --name dataonly --privileged -v /gluster ubuntu:14.04 /bin/bash
# in container
apt-get install -y glusterfs-client
mount -t glusterfs <...> /gluster

# Second container
sudo docker run -i -t --volumes-from dataonly ubuntu:14.04 /bin/bash

@mindscratch
Copy link

In test #3, from inside the second container were you able to access data in /gluster? I've tried the same setup but in my case the "/gluster" directory in the second container is empty.

@alexmipego
Copy link

As far as I can tell there is no way to directly expose a fuse filesystem mounted inside a container back to the host or other containers. I've been researching this issue for a couple days and the only "solution" would be to mount the fuse filesystem and expose it using a NFS share or similar.

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