Cannot mount NFS volume with Docker, can mount it otherwise
0
votes
0
answers
1989
views
I'm trying to set up an NFS volume shared by a TrueNAS server to use with my Docker container using Docker compose:
volumes:
data:
name: data
driver: local
driver_opts:
type: nfs
o: addr=[some_ip],rw,nfsvers=4
device: ":/Share/volumes/data/"
However, when creating the stack (docker-compose up -d
) Docker throws an error:
ERROR: for web Cannot create container for service web: failed to copy file info for /var/lib/docker/volumes/data/_data: failed to chown /var/lib/docker/volumes/data/_data: lchown /var/lib/docker/volumes/data/_data: operation not permitted
Now, I can mount this share and access it outside of Docker - and I can run the container if I add the :nocopy
flag at the end of my volume statement:
volumes:
- data:/some/dir #:nocopy
...but then data does not seem to be stored on the NFS share at all.
I've read suggestions online to use the no_root_squash
flag, but it seems to be both insecure and not easily available with the TrueNAS system.
I'd really appreciate some pointers in solving this.
Thanks!
Asked by PGEL
(187 rep)
Apr 28, 2022, 01:57 PM