0

I have created an NFS server in an AWS Ubuntu instance. Below is the exposed nfs device from NFS server.

df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvdb        30G  173M   28G   1% /mnt

Now in my swarm manager node, I am creating the nfs volume using this nfs server,

docker volume create --driver local --opt type=nfs --opt o=addr=<EC2 IP Address>,rw --opt device=:/dev/xvdb --name foo2

It will create the volume but inside the volume mountpoint, it is not displaying the data which is present in the NFS server's /mnt dir. I want to use the NFS server directly, I don't want to mount it to some local file.

What am I missing?

Siddharth
  • 884
  • 3
  • 11
  • 27

1 Answers1

0

Your issue seems quite similar to below -
https://github.com/docker/docker/issues/25202

You should use below while creating the service -

docker service create --mount type=volume,volume-opt=o=addr=192.168.99.1,volume-opt=device=:/Volumes/HDD/tmp,volume-opt=type=nfs ...
vivekyad4v
  • 13,321
  • 4
  • 55
  • 63