ContainX / docker-volume-netshare

Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin
http://netshare.containx.io
Apache License 2.0
1.12k stars 164 forks source link

Named NFS Volume for adhoc mounts fail #120

Open milk4candy opened 7 years ago

milk4candy commented 7 years ago

In func resolveName in /netshare/drivers/util.go, it seems I can use "#" symbol to name a volume using nfs driver on the fly when using docker run. For example, If I run following command

$ docker run -i -t --volume-driver=nfs -v nfshost/path#volume_name:/mount ubuntu /bin/bash

It should create a NFS volume named "volume_name" for container on the fly.

But it fail to do so.

milk4candy commented 7 years ago

It looks like there is a problem on the if statement in line 52 in /netshare/drivers/nfs.go. It will never be true since the "found" variable will always be undefined.

zx1986 commented 7 years ago

Does this

$ docker run -i -t --volume-driver=nfs -v 'nfshost/path#volume_name:/mount' ubuntu /bin/bash

work?

https://github.com/ContainX/docker-volume-netshare/blob/master/netshare/drivers/util.go#L35