Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is NFS volume type supported ? If not improve documentation please. #1700

Closed
Yivan opened this issue Feb 14, 2018 · 7 comments

Comments

@Yivan
Copy link

commented Feb 14, 2018

Hello,

First thank you for this nice project and the work put on it!

This issue is about NFS volumes.
It is said we can create NFS volume natively with docker. Great so we don't have to mount on the VM (and it is no more possible as all system is readonly).
Please see https://docs.docker.com/engine/reference/commandline/volume_create/#driver-specific-options

I tried many option during many hours with no luck, fetching forums and github with no details on this, question is simple:

Is NFS volume type supported or not on Docker for Windows and Docker for Mac ?

It seems there is no mount.nfs in the container (docker-ce) of the MobyLinuxVM (i manage to check it by using nsenter and mounting the docker-ce container or going in /containers/services/docker-ce/rootfs/sbin to check those installed).

  • If it is not supported, please update the documentation saying that Docker for Windows (and for Mac i think) don't support NFS volume type. And do you plan to make it supported ? This is such a important feature because NFS is a lot more performant from CIFS/SMB.
    Maybe nfs_utils package could be added to the MobyLinuxVM please as a first step (easy). And later provide GUI options for easy use.

  • If supported, it doesn't seems to work for me and some other peoples it seems. In this case we can go on the discussion on this issue: #1241

Thanks a lot!

@Yivan

This comment has been minimized.

Copy link
Author

commented Feb 14, 2018

I manage to make it work with docker-compose. I saw it worked with no-lock option.

The following work great:

docker volume create --driver local --opt type=nfs --opt o=addr=10.0.75.1,hard,nolock,rw --opt device=:/server-dev mynfs
docker run -it -v mynfs:/server-dev alpine sh

So it seems NFS volume is supported and work with no-lock option : ))

  • Why does it need it ?
  • Could you just explain wich NFS client is used (Windows 10 Pro one nfs client or MobyLinuxVM nfs client, but for this last one i didn't found the nfs_utils)
@pgayvallet

This comment has been minimized.

Copy link

commented Feb 14, 2018

Hello,

2 things :

  • nfs-utils package and nfs required services (rpcbind/statd) are not present in the docker-ce container in current edge/stable. Good news is, we added them recently for kubernetes nfs volume, and this will shipped in next edge / stable. 'plain' docker nfs volumes will then also work fully.

  • nfs mounts are performed inside the vm. I have no idea how simply using the no-lock option is enough to make the nfs volume working without mount.nfs. That's actually a very good question, and if you want the answer, you should probably ask in moby/moby repository !

@Yivan

This comment has been minimized.

Copy link
Author

commented Feb 14, 2018

@pgayvallet
Thanks for you fast answer!

  • Great news yes for nfs-utils for soon, so we can directly mount in the VM and make bind in the containers, it is more easy : )
  • For nfs with no-lock yes i don't know how it can work without mount.nfs, but it work (i got mount as NFS if i check, and is faster than SMB when i do benchmark so it isn't a fake nfs ; )) ).
    I will ask to moby/moby so!
@docker-desktop-robot

This comment has been minimized.

Copy link
Collaborator

commented Jul 30, 2018

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows.
/lifecycle stale

@mrk-te

This comment has been minimized.

Copy link

commented Jan 10, 2019

Hello,
Can you provide me a quick update on this topic. I need to access to data hosted on a NAS, shared with NFS, from a linux container running on Windows. Following docker version is running on windows (sounds to me like it's the last one) :

Client: Docker Engine - Community
Version: 18.09.0
API version: 1.39
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:47:51 2018
OS/Arch: windows/amd64
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 18.09.0
API version: 1.39 (minimum version 1.12)
Go version: go1.10.4
Git commit: 4d60db4
Built: Wed Nov 7 00:55:00 2018
OS/Arch: linux/amd64
Experimental: false

I try to create an volume with nfs :

docker volume create --driver local --opt type=nfs --opt o=addr=IPADDRESS,rw,hard,nolock --opt device=:/volume1/share nas_nfs
docker run -i -t --rm -v nas_nfs:/mount ubuntu /bin/bash

I got the following error :
docker: Error response from daemon: error while mounting volume '/var/lib/docker/volumes/nas_nfs/_data': error while mounting volume with options: type='nfs' device=':/volume1/share'

It works if I run the commands on Linux. The IP of the Windows host is authorized. I can't determine where the problem is.

The documentation about volumes mentions : "The built-in local driver on Windows does not support any options"
https://docs.docker.com/engine/reference/commandline/volume_create/

Can you please confirm if NFS is now supported in docker for windows ? With mount options ?
What is the right way to get data from a network share into a container ?

Thank you,

Marc

@mrk-te

This comment has been minimized.

Copy link

commented Jan 11, 2019

Hello,
Finally, I found the issue on the NFS server side.
Needed to accept connection from ports over 1024

Thank you

Marc

@lyling

This comment has been minimized.

Copy link

commented Sep 3, 2019

@mrk-te how to mount the nfs folder(from windows and linux). i create the volume with nfs. but it just an empty local folder from /xxx/docker/volumes//_data. nothing from my nfs server share folder.
don`t you mind tell me how and give me some tips and samples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.