Skip to content

Instantly share code, notes, and snippets.

@akleiber
Last active December 3, 2015 09:09
Show Gist options
  • Save akleiber/307c79e18846ada079a2 to your computer and use it in GitHub Desktop.
Save akleiber/307c79e18846ada079a2 to your computer and use it in GitHub Desktop.
add a custom directory to mount in docker toolbox on osx

beware, this will be overwritten if you run! docker-machine regenerate-certs <vm-name>

choose a hostpath that suits your needs

VBoxManage sharedfolder add "default" --name "data" --hostpath "/your/host/path/" --automount
VBoxManage setextradata "default" VBoxInternal2/SharedFoldersEnableSymlinksCreate/data 1
docker-machine ssh default
sudo -s
echo "mkdir -p /home/docker/data" >> /var/lib/boot2docker/profile
echo "mount -t vboxsf -o uid=1000,gid=50 data /home/docker/data" >> /var/lib/boot2docker/profile
docker run [...] -v /home/docker/data/another/path:/foo/bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment