Why isn’t my NFS mount visible in my Docker container?

0
0
Asked By CuriousCat42 On

I'm having trouble with an NFS mount on my local Ubuntu server (version 24.04). The NFS share is accessible from my machine just fine, and I'm trying to map it in Docker with the command `-v /mnt/folder:/folder`, but it doesn't show up in the container. I've tried running the container with privileged access, but that hasn't solved the issue. What could I be missing?

3 Answers

Answered By TechieTom On

One common issue is the user IDs not matching between your host and the container. Make sure the UID of the host user matches the container user. It sounds like you're mapping them correctly with `user: 1000:1000`, but double-check that on both sides.

HelpfulHannah -

Sounds like a good idea! Have you double-checked that the UID and GID match exactly? Sometimes discrepancies can cause these issues.

Answered By DockerDude On

What does your Docker command or docker-compose file look like? Also, ensure that the NFS mount is available before the container starts. Sometimes it can be a timing issue.

CuriousCat42 -

I thought about that too. I’m using `volumes: - /mnt/program:/program`, and it works for other local folders, but this NFS one just won’t show up.

Answered By NFSNinja On

How did you set up the NFS mount on the host? Are you using NFS version 4? If it's from a Synology NAS and it's mounted through fstab, it should usually work fine, but make sure the mount is accessible before starting your container.

CuriousCat42 -

Yes, it's version 4 from my Synology NAS, and it's visible on the host. Just not inside the container!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.