Name: docker-for-mac-nfs
Owner: Basecamp
Description: NFS shares in Docker for Mac
Forked from: stephank/docker-for-mac-nfs
Created: 2017-01-13 18:35:59.0
Updated: 2017-06-07 20:10:21.0
Pushed: 2017-02-03 17:48:31.0
Homepage: null
Size: 5
Language: Shell
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
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 import.sh
script
imports the stock ramdisk. The make.sh
script starts a container that
modifies its contents, adding files from extra/
, and running
container-script.sh
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.)
/Users
share./Users
export to /etc/exports
on your Mac:ere 501 is your user ID, and 20 your group ID. See the output of `id`.
rs -mapall=501:20 localhost
/etc/nfs.conf
:server.mount.require_resv_port = 0
nfsd
: nfsd restart
initrd.img
:port.sh
ke.sh
Quit Docker for Mac.
Backup the original initrd.img
, and replace it with the new one:
Applications/Docker.app/Contents/Resources/moby/initrd.img ~/docker-for-mac-initrd.img
/initrd.img /Applications/Docker.app/Contents/Resources/moby/initrd.img