docker-volume-plugins
docker-volume-plugins copied to clipboard
Question: Will the nfs plugin create a directory in nfs share if it not exists?
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?
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.
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.
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.
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.
Maybe it mounts the share to local directory and create volumes as sind directory inside of the local mountpoint?
The thing is I won't know the "base" export folder.
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...
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