Why isn't my NFS mount showing up in my Docker container?
Asked by
cOdE revue
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.
Answers
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.
Reply to this answer
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.
cOdE revue: Iโm mapping them with user: 1000:1000, which should be the host UID and GID.
Reply to this answer
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.
cOdE revue: 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.
Reply to this answer
Add your answer
Answers are reviewed before publication.
cOdE revue: 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.