Docker Community Forums

Share and learn in the Docker community.

Sharing files between host and container without volumes/mounting (for containerized GlusterFS)

(Masterfqf) #1

Hi there.

So I want to use GlusterFS for distributed storage between docker nodes. I want to keep the docker hosts as minimal as possible, so I’d rather run GlusterFS in it’s own dedicated container and expose the location of the distributed storage to the Docker host.

So I did just that, used the official gluster image to create a 3 node cluster and mounted /mnt/shared from each host to the same place in the containers (-v /mnt/share:/mnt/share), and inside each container I did the following:

mount.glusterfs localhost:cluster-share /mnt/share

And it worked great, and I had a replicated storage within my containers. However, once I tried accessing /mnt/shared from the host, it was empty. It makes sense because volumes essentially mount the folder to the container, which I override by using the mount command inside the container.

Is there any way around this so that I can access the shared storage from within the host without installing GlusterFS locally (again - to keep the hosts as clean and minimal as possible)?