Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



8 Commits

Repository files navigation


This is a hack to setup NFS for /Users in Docker for Mac, for those of us who disagree with the filesystem performance of the stock installation. It is tested on macOS Sierra with Docker for Mac 1.12.

If you're using this, you'll do so at your own risk. You'll likely need to rerun the setup on every upgrade of Docker for Mac.


Blog post

Docker for Mac transparently runs a virtual machine, which boots from a ramdisk. The ramdisk is an Alpine Linux based system called Moby. Shares configured in the preferences are normally mounted with a custom FUSE filesystem called osxfs, which has less than stellar performance.

These scripts modify the ramdisk to setup NFS instead. The script imports the stock ramdisk. The script starts a container that modifies its contents, adding files from extra/, and running in a chroot shell. The contents is then dumped back to a ramdisk, ready for use.

The current setup is to add the nfs-utils package, and a custom init script to mount the share. (Simply adding an entry to /etc/fstab seems to not work.)


  • Install and run Docker for Mac.
  • In the Docker for Mac preferences, remove the /Users share.
  • Add a /Users export to /etc/exports on your Mac:
# Where 501 is your user ID, and 20 your group ID. See the output of `id`.
/Users -mapall=501:20 localhost
  • Add the following line to /etc/nfs.conf:
nfs.server.mount.require_resv_port = 0
  • Restart nfsd:
sudo nfsd restart
  • Create the new initrd.img:
  • Quit Docker for Mac.

  • Backup the original initrd.img, and replace it with the new one:

mv /Applications/ ~/docker-for-mac-initrd.img
mv ./initrd.img /Applications/
  • Restart Docker for Mac.
  • Profit.


NFS shares in Docker for Mac






No releases published


No packages published