Skip to content

Instantly share code, notes, and snippets.

@include
Last active August 29, 2015 14:07
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save include/7475770458d24b198812 to your computer and use it in GitHub Desktop.
Save include/7475770458d24b198812 to your computer and use it in GitHub Desktop.
boot2docker with shared folders
# Install
brew update && brew upgrade
brew install docker
brew install boot2docker
brew cleanup
brew install caskroom/cask/brew-cask
brew cask install virtualbox
brew cask install vagrant
brew cask cleanup
# Fix mount/share
mkdir -p ~/.boot2docker
curl http://static.dockerfiles.io/boot2docker-v1.2.0-virtualbox-guest-additions-v4.3.14.iso > ~/.boot2docker/boot2docker.iso
boot2docker init
VBoxManage sharedfolder add boot2docker-vm --name home --hostpath /Users --automount
# Start VM
boot2docker up
boot2docker ip
=> 192.168.59.107
export DOCKER_HOST=tcp://192.168.59.107:2375
# Setup Share
mkdir -p ~/prj
touch ~/prj/foobar
# Start container
docker run -i -t -v /Users/include/prj:/data/project1 ubuntu /bin/bash
root@fdb44a74a408:/# ls -ls /data/project1/
total 0
0 -rw-rw-r-- 1 root root 0 Oct 8 22:20 foobar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment