NFS, docker-compose, "failed to mount local volume:…"


I’m asking the Docker community for help because I’m facing a problem.

I execute a docker-compose which launches a docker swarm stack, I want to mount an NFS volume but I get an error message.

Error message >> “failed to mount local volume:…”

Can you help me ?
Is my configuration correct ?
I can map the network share and write to it from ubuntu.



      type: "nfs"
      o: "addr=,nfsvers=4"
      device: ":/postgresql_data"

docker volume inspect

### docker volume inspect
root@xxxxxx:/opt/Alfresco# docker volume inspect Alfresco_postgresql_data
        "CreatedAt": "2023-10-14T09:53:19Z",
        "Driver": "local",
        "Labels": {
            "com.docker.stack.namespace": "Alfresco"
        "Mountpoint": "/var/lib/docker/volumes/Alfresco_postgresql_data/_data",
        "Name": "Alfresco_postgresql_data",
        "Options": {
            "device": ":/postgresql_data",
            "o": "addr=,nfsvers=4",
            "type": "nfs"
        "Scope": "local"

I’ve just tested this configuration and it doesn’t work either, but I have another error :

Error message >> failed to copy file info for …

Do you have any ideas ?
Thanks you


### Volumes 

    driver: local
      type: "nfs"
      o: "addr=,rw"
      device: ":/postgresql_data"

Please format your posts according How to format your forum posts

Please also share full error messages, so we can see their origin and understand the context.

Hello Meyay,

Thanks for your feedback, this is my second post so please bear with me :slight_smile:

How can I get the full error message?
It’s not displayed in full.
Is it possible to see it somewhere in the logs?

Thanks for your feedback.

Assuming your nfs server has the ip, the installed nfs server serves version 4 and you exported the folder /postgresq_data, and your docker host ip is allowed to access the export, then it should be correct.

The output of volume inspect is as expected.

You need to make sure the unix file permissions are alligned between the shared remote folder and the uid:gid of the container process. So if your nfs share is owned by uid xxxx, but the container runs as uid yyyy, then the container won’t be able to access the share.

Please share following outputs

  • from the nfs server:
ls -lan /postgresq_data
ip addr show scope global
cat /etc/exports
  • from the docker host:
ip addr show scope global

Thank you for your prompt reply.

The server IP address is indeed, it’s a Windows Server 2022 with the NFS role.
I’ve opened all accesses, and the same goes for the firewall.

Information that may be important: server is the domain controller and the Ubuntu 22.04 server with IP address is a member of this domain.

How can I align permissions between the container and the remote folder?
How do I know it’s NFS version 4 installed on Windows Server 2022? >> Installer et configurer un serveur et un client NFS sous Windows Server 2016 - Windows Server - Tutoriels - InformatiWeb Pro

Is there a workaround?

This is the first time I’ve used NFS on Windows Server 2022.

Thank you very much for your help.

ip a

### from the docker host:

3: ens36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:0c:29:11:6f:d2 brd ff:ff:ff:ff:ff:ff
    altname enp2s4
    inet brd scope global ens36
       valid_lft forever preferred_lft forever

**ipconfig /all**

### from the nfs server:

Carte Ethernet Ethernet0 :

   Suffixe DNS propre à la connexion. . . :
   Description. . . . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
   Adresse physique . . . . . . . . . . . : 00-0C-29-1A-F0-7A
   DHCP activé. . . . . . . . . . . . . . : Non
   Configuration automatique activée. . . : Oui
   Adresse IPv4. . . . . . . . . . . . . .:éféré)
   Masque de sous-réseau. . . . . . . . . :
   Passerelle par défaut. . . . . . . . . :
   Serveurs DNS. . .  . . . . . . . . . . :
   NetBIOS sur Tcpip. . . . . . . . . . . : Activé

### Get-WindowsFeature

[X] Services de fichiers et de stockage                 FileAndStorage-Services        Installed
    [X] Services de fichiers et iSCSI                   File-Services                  Installed
        [X] Serveur de fichiers                         FS-FileServer                  Installed
        [ ] BranchCache pour fichiers réseau            FS-BranchCache                 Available
        [ ] Déduplication des données                   FS-Data-Deduplication          Available
        [ ] Dossiers de travail                         FS-SyncShareService            Available
        [ ] Espaces de noms DFS                         FS-DFS-Namespace               Available
        [ ] Fournisseur de stockage cible iSCSI (fou... iSCSITarget-VSS-VDS            Available
        [X] Gestionnaire de ressources du serveur de... FS-Resource-Manager            Installed
        [ ] Réplication DFS                             FS-DFS-Replication             Available
        [ ] Serveur cible iSCSI                         FS-iSCSITarget-Server          Available
        [X] Serveur pour NFS                            FS-NFS-Service                 Installed
        [ ] Service Agent VSS du serveur de fichiers    FS-VSS-Agent                   Available

I won’t be able to help with Windows Server - I didn’t touch it the last 10 years :slight_smile:

I will leave this one for someone else to answer.

1 Like


Thank you very much for your help.