Docker NFS Volume Permission Denied

3.5k Views Asked by At

Firstly, I am very new to NFS and the Linux world.

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:

ERROR: for pi_mariadb_1  Cannot create container for service mariadb: open /var/lib/docker/volumes/testnfs2/_data: permission denied

For docker volume create I am running the following:

 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

My open media vault share setting is shown below:

Open media vault share

Does anyone know how to fix this issue, or may be able to guide me to troubleshooting why it is not working?

0

There are 0 best solutions below