Mounting GlusterFS volume to docker service using --mount flag

Hi - I am here to ask for help, maybe I am doing something wrong. I am able to mount GlusterFS volume by creating container

docker run --name gluster --hostname=gluster -d --privileged=true --network=host gluster/gluster-centos 

And than mounting it by

docker exec -it gluster mount -t glusterfs 81.2.252.144:/test /test

What I am failing to achieve is to mount the volume right into docker service using --mount flag. I tryed many commands, and got back to volumes (it is easier to debug). Once I get volume done, I will get back to struggling with --mount flag. The most actual command is:

docker volume create -o device=81.2.252.144:/test,type=fuse.glusterfs,o=default_permissions,o=allow_other,o=max_read=131072,o=fd=7,rootmode=40000,user_id=0,group_id=0 --name glusterVOL

If you are asking where I found all those arguments, let me show you full untruncated call (digged from strace). The important part is

mount("81.2.252.144:/test", "/mnt", "fuse.glusterfs", 0, "default_permissions,allow_other,max_read=131072,fd=7,rootmode=40000,user_id=0,group_id=0")

The wierd part is, that call pasted to docker daemon is the same

mount("81.2.252.144:/test", "/var/lib/docker/volumes/test/_data", "fuse.glusterfs", 0, "default_permissions,allow_other,"...)

Any ideas?

2 Likes