i have one “Gluster-Container”. This container has the glusterfs-client installed and mounts an glusterfs volume to /mnt/storage.
My goal is to share /mnt/storage (with the mounted gluster volume) with other containers. To accomplish this, i tried the following docker-compose file:
php: image: php-image hostname: php volumes: - gluster-volume:/mnt/storage gluster: image: gluster-image privileged: true volumes: - /root/fstab:/etc/fstab - gluster-volume:/mnt/storage volumes: gluster-volume:
But that didn’t work out.
GlusterFS is already mounted on /mnt/storage. So when docker want to mount a volume to /mnt/storage it will fail. I guess? I don’t know exactly because i don’t get any errors. The shared volume just doesn’t work (items don’t get shared between containers/volume stays empty).
Any ideas/considerations how to solve this problem are welcome!
What i already tried:
- Some weird stuff with –make-shared and -make-unbindable (see: https://s3hh.wordpress.com/2011/09/22/sharing-mounts-with-a-container/)
Solutions that may work:
- Install gluster-client in all the other containers (this sucks escpacially because the gluster container needs to be privileged.).
- Install a SMB-Server and a SMB-Client.
But I am not happy with any of these solutions.