1

I'm having huge problems with sharing an NFS Volume in a docker swarm. I'm always getting this error:

error while mounting volume .... permission denied

The entry in my /etc/exports file looks like this: /home *(rw,sync,no_subtree_check)

The docker compose file:

version: '3.2'
volumes:
 selenoid_nfs:
   driver: local
   driver_opts:
     type: nfs
     o: addr=<nfs-Host-ip>,rw
     device: :<path to directory in nfs server>
services:
  selenoid:
    image: "aerokube/selenoid"
    ports:
      - "4444:4444"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - selenoid_nfs:/etc/selenoid
  • My nfs-Host is also the swarm manager.
  • When running docker stack deploy, a service will be created on a worker node. But the service is always shutting down and restarting because of the permission denied error.
  • When I start the container directly on the worker node the volume is mounted without any problem.
yosrO
  • 161
  • 1
  • 3
  • 12

1 Answers1

0

Do you use sudo exportfs -a to apply changes of /etc/export on the nfs server?

and also I use this kind of syntax in the docker-compose file and worked for me.

volumes:
  data:
    driver: local
    driver_opts:
      type: "nfs"
      o: addr=<nfs-Host-domain-name>,rw,sync,nfsvers=4.1
      device: ":<path to directory in nfs server>"
Jtown
  • 3
  • 2
namaiiee
  • 61
  • 7