docker-volume-plugins icon indicating copy to clipboard operation
docker-volume-plugins copied to clipboard

Question: Will the nfs plugin create a directory in nfs share if it not exists?

Open pwFoo opened this issue 7 years ago • 8 comments

Default docker nfs support doesn't create the needed directory for the volume (for example by volume name inside of the base nfs share directory). Is it supported with your plugin?

pwFoo avatar Sep 17 '18 10:09 pwFoo

I found that it does not for the GlusterFS plugin. So that functionality is likely not in NFS plugin either. Given that, I may need to provide a way of providing a flag to automatically create the folder as you have stated.

trajano avatar Sep 17 '18 15:09 trajano

For NFS, I don't think it is possible given the way I have implemented it. For one, NFS requires the export to be known first. It can't really guess where the base is as shown here device=192.168.1.1:/mnt/routerdrive/nfs .

Gluster on the other hand may be doable because the "subdir" portion is is separate from the mount point.

trajano avatar Sep 19 '18 02:09 trajano

OK, thanks for checking it @trajano. So there ist just one plugin I have found which works that way I need, but convoy is no more maintained / supported.

pwFoo avatar Sep 19 '18 04:09 pwFoo

I wonder how they would do it for NFS. Unless the can control the NFS daemon to create and export other paths which doesn't really sound right.

trajano avatar Sep 19 '18 17:09 trajano

Maybe it mounts the share to local directory and create volumes as sind directory inside of the local mountpoint?

pwFoo avatar Sep 19 '18 17:09 pwFoo

The thing is I won't know the "base" export folder.

trajano avatar Sep 19 '18 17:09 trajano

Local mountpoint (for example /var/lib/docker-nfs-volumes) could be a plugin option? So all nfs volumes just local mappings like docker named volumes (/var/lib/docker/volumes). I think that is the way how convoy works. But it's unmaintained today...

pwFoo avatar Sep 19 '18 17:09 pwFoo

docker-volume-netshare do it, has a special option to create destination folder.

Here (https://github.com/ContainX/docker-volume-netshare/blob/master/netshare/drivers/nfs.go) you may find the implementation, it would be very usefull have the same behaviour

matzmz avatar Dec 03 '18 09:12 matzmz