Set Up Docker For Mac with Native NFS

Finally, a faster way to sync your development environment

Last week, Docker-For-Mac shipped with brand new native NFS support!

For those of us using Docker to manage our local development environment, this is really good news because OSX’s filesystem isn’t fast enough to make most web apps useable locally combined with Docker. That’s certainly what we’ve found with Rails, anyway.

We’ve tried a few ways around this, such as docker-sync and docker-machine but they seem clunky and error-prone.

So how do we get the ball rolling with NFS?

The Magic

The solution is two-fold: a bash setup script to ensure NFS is configured correctly on your Mac, and a volume stanza inside your docker-compose YAML.

Once the setup script is run, docker-compose can bring up your app using native NFS to keep your source code in sync with the code inside the container.

That’s all folks — it’s as simple as that.

Like what you see? Join us, we’re hiring. 🚀