I’m working with NFS Volume.
I created a NFS server and on my rasberry pi I set the client and if I mount the directory exposed I can see the content, It’s mean that the configuration works.
My goal is to create a volume with the following command:
docker: Error response from daemon: failed to mount local volume: mount :/export/users/reddata:/var/lib/docker/volumes/foo/_data, data: addr=10.0.0.5: connection refused.
See 'docker run --help'.
I this that something it’s not authorized, but I also think that I can mount my shared directory on my pi the configuration previous did should works.
It is a good practice to try a mount on the shell first.If it succeeds, create your volume.
It seems like your host is not allowed to accees the exported nfs-share. On the nfs server, make sure that the ip or ip range of your docker host is listed in /etc/exports.
Thanks a lot to join.
I tried to mount the directory directly on the filesystem and works, But when I try with docker I receive the error.
My /etc/exports it the follow:
Now lets check if the behavior is the same with a container without restricted user: sudo docker run -it --rm --name nfs-test -v foo:/data alpine sh
If this doesn’t work, try to use o=addr=10.0.0.5 when creating the volume instead of o=addr=10.0.0.5,rw.
Make sure to use nfsv4 or v4.1 if you want to have a consitant good experience with docker and nfs shares. Eventually nfs3 will make you unhappy in this context. If you use nfsv4 try o=addr=10.0.0.5,nfsvers=4