Automagically install Docker in a VirtualBox VM with super-fast NFS mounts.
- Uninstall Docker for Mac
- Install Virtualbox
- Install docker client binaries
- Create a boot2docker VM
- Set up NFS mounts for VM
- Set up docker environment in
.bash_profile
,.zprofile
orfish.config
(optional!)
Use the latest docker version, 4GB RAM for the VM and set up .bash_profile
:
curl -sfSL https://github.com/dziemba/mobymac/raw/master/install.sh |bash -s bash 4096
# download installer
curl -sfSL https://github.com/dziemba/mobymac/raw/master/install.sh -o mobymac.sh
chmod +x mobymac.sh
# verify that it does what you want
less mobymac.sh
# run it
./mobymac.sh
# ... or run it with more params:
# ./mobymac.sh [shell integration] [VM memory in MB] [Docker version]
./mobymac.sh zsh
./mobymac.sh zsh 2048
./mobymac.sh zsh 2048 v17.06.0-ce
Shell integration can be one of the following: bash
, zsh
, fish
or manual
.
- Yes, the name mobymac is very confusing.
- This will destroy all your existing docker data, be careful!
- NFS mounts have less guarantees regarding FS consistency - in practise it should just work (tm)
- Ports are not mapped to localhost - run
docker-machine ip
to find out the docker VM IP
Docker for Mac is an awesome project - use it if you can. It is however still slower than this approach. Also there are some weird DNS issues that do not occur with a VBox solution. When Docker for Mac is stable enough, this project will become obsolete.
- https://github.com/adlogix/docker-machine-nfs
- docker/for-mac#77
- https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076/256
I'm happy about any feedback! Feel free to open issues or create PRs.
MIT, see LICENSE