Has anyone successfully used the new NFS support in the latest D4M 8.03.0-ce-mac59 (23608)?
Is there specific documentation for how to get this working? I’ve been trying to get my container to sync with a directory on my mac. The OSX local filesystem is too slow for my Rails app.
I’ve tried a few things with docker-compose but I’m unsure what the IP address of the NFS server should be.
Hi Sean,
I’m using NFS on mac and latest docker. I’m not certain if you want to do the nfs mount in docker or from mac and then bind-mount. I’m using the latter where I mount_nfs via mac terminal and then use -v option when running docker image. The only issue I found was that I couldn’t write to the nfs volume unless I chmod 777 the files (see an earlier post).
I’ve had similar feedback from other people also, yet it works fine on my machine (and my colleagues). There’s clearly something missing but it’s not clear what…
Thanks! It is possible to have this working also with https://hub.docker.com/_/mysql/ ?
Trying to mount the mysql data (/var/lib/mysql) inside the nfs volume but it gives me failed to chown errors
Sorry, I’m not sure what you can do. This solution relies on mapping UID/GID to a known pair on OSX - as such this means you can’t chown files inside the container and expect the operation to succeed on the mounted directory.
There is an option called no_root_squash for NFS which you can add to /etc/exports but it seems the OSX version of NFS doesn’t support this feature.
I’m coming back after a few day of work with symfony and docker volume nfs and …
It was good for perf on display website.
It was not good for development.
A lot of time were I work I have to wait when I refresh website because they don’t have access to the file that I modify.
It was maybe a issue with the sync but for development, it’s annoying to wait after modify file, it’s a waste of time.
Conclusion, it’s a lot better but for web development with symfony it’s not good I must continue to use my VM with Debian and sync file with PhpStorm …
You can adjust the NFS options in your docker-compose yaml and see if you get better performance. The settings I landed on were trial and error with a Rails application. Check out the man pages for NFS options and see if tweaking them helps - remember you need to docker-compose down and docker volume prune -f between changes to the config.
Hi Sean,
your solution works for me thank you very much!
Just one question. Every time I reboot my Mac I need to execute a “sudo nfsd restart” before the “docker-compose up” to get it working properly. Does this happen to you?
No, this doesn’t happen to me - but the containers I tend to test with aren’t brought up automatically so I suspect nfsd is already running before they start.
Even my containers aren’t brought up automatically and I already verified that nfsd is running before bringing them up (with a “ps aux | grep nfsd”). Anyway after a Mac boot, even if nfsd is running, I have to run “sudo nfsd restart” to have those containers working.
Thank you for feedback anyway!
It may be the same issue we have in Windows where there is a race condition of the share drive not connected yet before the containers start up. The docker managed plugins alleviate the issue by ensuring that they run BEFORE the containers.