I'm having trouble with an NFS mount that works fine on my local Ubuntu machine, but when I try to map it in a Docker container, it's not showing up. I'm using the command to map it as -/mnt/folder:/folder, but even though my container is running in privileged mode, that hasn't solved the issue. I'm running on Ubuntu Server 24.04, and I'm wondering what I'm missing here.
3 Answers
What does your Docker command look like? Make sure that the NFS mount is properly set up before your container starts. It might be helpful to verify that the mount exists and is accessible first, then start the container.
Have you checked if the UID of the user on your host matches the UID of the user in the Docker container? If they're different, it could be causing the issue with the mount not being visible.
I’m mapping them with user: 1000:1000, which should be the host UID and GID.
It's important to look at how you mounted the NFS on the host. What NFS version are you using? This info can really help pin down the problem.
I'm using NFS version 4 from a Synology NAS. It’s set up through fstab and is visible in the host OS, just not in Docker.
I’ve tried starting them afterward, but it still doesn't work. The volumes look like this: - /mnt/program:/program. All other local folders map just fine except for that NFS one.