Open ChristianKniep opened 8 years ago
This is true but has nothing todo with the plugin. Since docker-volume-netshare uses a mount command internally it is bound by the capabilities of mount.
Convince yourself with mount -t nfs host:/some/non/existing/dir /somewhere
;-)
I was just about to open a ticket for this. Given this command
docker volume create -d nfs --name myvol -o share=nfshost:/share
I expected the plugin to mount nfshost:/share, and then create the directory 'myvol' on the mount if it doesn't already exist
given the way it works now, I'll have to manually create directories for every volume I want to put on the share. That works, but in the long run makes it less friendly..
Hmmm.... Actually the --name myvol
is just a logical entity (a name) that should not have any relationship to a physical directory...
What I could imagine is the following
docker volume create -d nfs --name myvol -o share=nfshost:/share/myvol -o create=yes
With option create=yes
docker-volume-netshare
would do the following:
nfshost:/share
)@bkcsfi Would this help to you?
Yes, this would be helpful. Can the create=yes option also be specified in the volume section of a swarm file? That's ultimately how I would be using it.
Thanks
Hi,
I think that it would be even more helpful if the share was considered as a volumes set, and the named volume would be created in it, something like :
docker volume create -d nfs --name myvol -o share=nfshost:/share -o create=yes
And considering the path is a myvol (based on the volume name) folder in nfshost:/share.
Because without it, I find it confusing, in fact I don't really see what's the advantage of using the netshare volume plugin against having the NFS shares mounted on all docker hosts and using bind volumes (if you have to explicitly create the folders, and explicitly ask for the specific share, that's not much work).
But I might be missing some point.
Regards,
I think that it would be even more helpful if the share was considered as a volumes set, and the named volume would be created in it, something like :
docker volume create -d nfs --name myvol -o share=nfshost:/share -o create=yes
I agree on that. My expectation was also, that the driver would create a Directory for each volume (by Name) within my NFS share. The current situation, that i would need to define one nfs export per named volume, is quite cumbersome.
I like this idea a lot. Lets see if we get a few more votes and this can be the change of direction. I will start prototyping this in the meantime and making sure it works with clusters like Mesos as well.
Could someone create a new issue stating what this enhancement should do and I will flag it for voting
I did create a new issue https://github.com/ContainX/docker-volume-netshare/issues/72 to desribe the proposed change.
Error
Error response from daemon: create myvol: Error looking up volume plugin nfs: legacy plugin: Post http://%2Frun%2Fdocker%2Fplugins%2Fnfs.sock/Plugin.Activate: dial unix /run/docker/plugins/nfs.sock: connect: connection refused
Hey there,
I might just be a bit confused, but it seems to me that the plugin assumes that the remote directory on the NFS server has to be created before hand, am I right?
Daemon output:
When I mount it:
Output:
But when I create it myself
mkdir /srv/nfs/test
, it works: