Skip to content

Instantly share code, notes, and snippets.

@maxnasonov
Last active September 10, 2016 19:14
Show Gist options
  • Save maxnasonov/64bcfe806dac2b5c881e to your computer and use it in GitHub Desktop.
Save maxnasonov/64bcfe806dac2b5c881e to your computer and use it in GitHub Desktop.
Move docker volumes to the host to fix permission issues on Mac OS
Mac:
edit /etc/exports
edit /etc/nfs.conf
sudo nfsd restart
ln -s /Users/nasonov/Dropbox/projects /projects
ln -s /projects/some-project /Users/user/some-dir/some-volume/_data
B2D:
sudo /etc/init.d/docker stop
sudo mv /mnt/sda1/var/lib/docker/volumes /Users/user/some-dir
sudo ln -s /Users/user/some-dir /mnt/sda1/var/lib/docker/volumes
sudo touch /mnt/sda1/var/lib/boot2docker/bootlocal.sh
sudo chmod +x /mnt/sda1/var/lib/boot2docker/bootlocal.sh
edit /mnt/sda1/var/lib/boot2docker/bootlocal.sh
reboot
#!/bin/sh
# Boot2Docker's /mnt/sda1/var/lib/boot2docker/bootlocal.sh
/usr/local/etc/init.d/nfs-client start
sudo mount 192.168.99.1:/Users/nasonov/docker-volumes /mnt/sda1/var/lib/docker/volumes -o rw,async,noatime,actimeo=1,nolock,vers=3,tcp
mkdir /projects
sudo mount 192.168.99.1:/Users/nasonov/Dropbox/projects /projects -o rw,async,noatime,actimeo=1,nolock,vers=3,tcp
/Users/user/some-dir -maproot=root -alldirs -rw -network 192.168.99.0 -mask 255.255.255.0
nfs.server.mount.require_resv_port = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment