title: Docker NFS Volume Permission Denied
body: <p>Firstly, I am very new to NFS and the Linux world.</p>
  <p>I am trying to migrate my docker swarm containers from using local volumes, to a shared volume on nfs.
  I have a server with open media vault installed and I have a NFS share of /mariadb exposed which is accessible through the showmount command.
  When trying to create the deployment using docker stack deploy, or docker volume create, I get a permission denied error from the deployment:</p>
  <pre><code>ERROR: for pi_mariadb_1  Cannot create container for service mariadb: open /var/lib/docker/volumes/testnfs2/_data: permission denied
  </code></pre>
  <p>For docker volume create I am running the following:</p>
  <pre><code> docker volume create --name testnfs2 --driver local \
  --opt type=nfs4 \
  --opt o=addr=192.168.8.123,rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14 \
  --opt device=:/mariadb
  </code></pre>
  <p>My open media vault share setting is shown below:</p>
  <p><a href="https://i.stack.imgur.com/GVu4s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GVu4s.png" alt="Open media vault share" /></a></p>
  <p>Does anyone know how to fix this issue, or may be able to guide me to troubleshooting why it is not working?</p>