Skip to content

Instantly share code, notes, and snippets.

@hrldcpr
Last active August 29, 2015 14:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hrldcpr/67b78e68335eeeeb6ddc to your computer and use it in GitHub Desktop.
Save hrldcpr/67b78e68335eeeeb6ddc to your computer and use it in GitHub Desktop.
installing Docker on a Mac, such that `docker run -v ...` works for anything under /Users

First, install VirtualBox. Then:

brew update
brew upgrade
brew install docker boot2docker

mkdir ~/.boot2docker
curl http://static.dockerfiles.io/boot2docker-v1.1.2-virtualbox-guest-additions-v4.3.12.iso \
> ~/.boot2docker/boot2docker.iso
# (get the URL of the latest ISO at
# https://medium.com/boot2docker-lightweight-linux-for-docker/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c)

boot2docker init
VBoxManage sharedfolder add boot2docker-vm --name home --hostpath /Users --readonly

echo 'export DOCKER_HOST=tcp://$(boot2docker ip 2>/dev/null):2375' \
>> ~/.profile

# or if you're using fish:
# echo 'set -x DOCKER_HOST tcp://(boot2docker ip 2>/dev/null):2375' \
# >> ~/.config/fish/config.fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment