My docker engine is running on Ubuntu 16.
I tried to setup NFS server based on : Using https://github.com/ErezHorev/dockerized_nfs_server/blob/master/docker/Dockerfile
NFS server is running now . container IP is 172.17.0.2
But I am not able to mount in same container or from other container .
Error :
root@71d5a4bc32bc:/# mount -v -t nfs -o proto=tcp,port=2049 172.17.0.2:/exports/opt /mnt
mount.nfs: timeout set for Tue Aug 9 13:06:36 2016
mount.nfs: trying text-based options 'proto=tcp,port=2049,vers=4,addr=172.17.0.2,clientaddr=172.17.0.2'
mount.nfs: mount(2): Operation not permitted
mount.nfs: trying text-based options 'proto=tcp,port=2049,addr=172.17.0.2'
mount.nfs: prog 100005, trying vers=3, prot=6
mount.nfs: portmap query failed: RPC: Program not registered
**mount.nfs: requested NFS version or transport protocol is not supported**
Debugging
root@71d5a4bc32bc:/# rpcinfo
program version netid address service owner
100000 4 tcp6 ::.0.111 portmapper superuser
100000 3 tcp6 ::.0.111 portmapper superuser
100000 4 udp6 ::.0.111 portmapper superuser
100000 3 udp6 ::.0.111 portmapper superuser
100000 4 tcp 0.0.0.0.0.111 portmapper superuser
100000 3 tcp 0.0.0.0.0.111 portmapper superuser
100000 2 tcp 0.0.0.0.0.111 portmapper superuser
100000 4 udp 0.0.0.0.0.111 portmapper superuser
100000 3 udp 0.0.0.0.0.111 portmapper superuser
100000 2 udp 0.0.0.0.0.111 portmapper superuser
100000 4 local /run/rpcbind.sock portmapper superuser
100000 3 local /run/rpcbind.sock portmapper superuser
100024 1 udp 0.0.0.0.146.187 status 102
100024 1 tcp 0.0.0.0.225.53 status 102
100024 1 udp6 ::.221.215 status 102
100024 1 tcp6 ::.237.126 status 102
root@71d5a4bc32bc:/# rpcinfo -p 172.17.0.2
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
100024 1 udp 37563 status
100024 1 tcp 57653 status
root@71d5a4bc32bc:/# showmount -e 172.17.0.2 clnt_create: RPC: Program not registered
Edit
When I ran
service nfs-kernel-server start
mount: permission denied
* Exporting directories for NFS kernel daemon...
exportfs: could not open /proc/fs/nfs/exports for locking: errno 13 (Permission denied)
[ OK ]
* Starting NFS kernel daemon rpc.nfsd: Unable to access /proc/fs/nfsd errno 2 (No such file or directory).
Please try, as root, 'mount -t nfsd nfsd /proc/fs/nfsd' and then restart rpc.nfsd to correct the problem
Port 2049 was never up .
docker
containers are still using your host's kernel, so they only have access to the facilities your host has compiled and loaded. Thus, you can't avoid needing to load (if modularized), or recompile with (if not) kernel modules that are effective prerequisites for functionality. – Acarus--priveleged
flag in yourdocker run
command? – Prolactin