Docker Community Forums

Share and learn in the Docker community.

How to mount NFS to windows docker container?

Hi All, I am not able to see file sharing tab in settings anymore for docker desktop. I want to mount NFS folder to windows docker container. I am using below command:

docker run -v "$HOME\foo:C:\Users\ContainerAdministrator\foo" --mount type=volume,dst=M:\,volume-opt=type=nfs,volume-opt=device=:FileSystem-D,volume-opt=o=addr= -p 80:80 -p 81:81 -p 443:443 -p 8080:8080 -p 8081:8081 -p 4848:4848 -it --entrypoint="docker-entrypoint.bat" docker/win2019 cmd

So, for the mount the above uses:

--mount type=volume,dst=M:\,volume-opt=type=nfs,volume-opt=device=:FileSystem-D,volume-opt=o=addr=

getting this error: options are not supported on this platform.

Appreciate urgent help…


Asides, not answering your main question: for the CIFS/NFS shares I used from a Windows Docker Desktop running Linux containers, the file sharing page was not involved to grant access. Also, once I somehow had broken things, I could remove erroneous lines from some AppData\Roaming\Docker\settings.json.

Mounting NFS share on a linux container shouldn’t be a problem. Can be done using -v option… but the same option don’t work for windows containers.

1 Like