NFS Share empty

We would need to see how you created the container and know more about your environment in order to help.

The point of a persistent volume is that when you write data into a container’s filesystem, that is only temporary as long as the container exists. And containers are deleted when a new image is used after an upgrade or when you change some parameters. So you would lose data frequently without a volume or bind moutned folder.

If you don1t see the data written to the NFS server, you likely mounted the source folder to a wront one in the container or used a wrong source. Docker can show error message only when it can detect something was wrong. If the mount point or the source is wrong, that is not something it can detect. In case of NFS, it is also possible that you mounted the folder before the NFS server’s fodler was mounted. Not likely when you are duing it manually, but if a process already read the filesystem before mounting the NFS fodler, it could see the original folder before the mount, so even if you see the folder was mounted from the NFS server, it is possible the process still don’t see it.

We can say more only when you share more info. A compose file or docker run command could help a lot depending on how you created the container. Please share also how you installed Docker. Let me share a question template and ignore the info you already shared:


We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts

1 Like