Unable to mount NFS fileshare to Docker container running on Azure VM

Mikó Bálint 0 Reputation points
2023-08-21T11:50:29.2933333+00:00

We would like to deploy our application which is running in multiple Docker containers to an Azure Virtual Machine. We would like the Docker containers to be able to mount volumes directly from an Azure Files NFS share.

The NFS share is easily mountable to the VM itself, but not to the containers. We tried both CNI and CNM network plugins (plugin installation and setup were done as suggested on Microsoft/Github documentations) for Docker, but none of them worked for us.

We always get "connection timed out" or "permission denied" errors.

The only solution we found was running Docker containers with the "--privileged" and "--network=host" options, but it is not a practical nor a secure long term solution based on the security guidlines we found.

We also tried to use blobfuse2 with another storage account and a blob container, but the resultts were the same. The blob container was mountable to the VM but not to the Docker containers directly unless the "--privileged" and "--network=host" options were set.

Is there anything else we should try/check? Azure Virtual Network setup, Docker setup or maybe something we missed configuring the Azure Files NFS share?

Ubuntu 20.04.6 LTS

Docker 24.0.5

The environment is currently in an early state, so no special network security rule is present, just the Azure defaults.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,424 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,035 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.