Mounting NFS Shares in Docker Compose
Stuff I think is interesting, cool, or otherwise worth sharing™️.
While playing with Tubearchivist, I discovered that it might be in my best interests to mount an nfs share as a volume inside docker…
I found the least complicated way to do it in docker compose
. Here’s the snippet from docker-compose.yml
:
#compose file
name: someComposeRig
#...
volumes:
nfs-media:
driver: local
driver_opts:
type: "nfs"
o: nfsvers=4,addr=pine.wolfspyre.io,rw,relatime,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2
device: ":/mnt/Pine/Videos/TubeArchivist"
#...