Skip to content

Instantly share code, notes, and snippets.

@bmpvieira
Created January 26, 2014 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bmpvieira/8638504 to your computer and use it in GitHub Desktop.
Save bmpvieira/8638504 to your computer and use it in GitHub Desktop.
Docker running natively in OSX connected to daemon running inside Vagrant
#!/bin/bash
# Docker running natively in OSX connected to daemon running inside Vagrant
#
# This allows to use Docker natively in an OSX terminal, connected to a docker
# daemon running inside a CoreOS VM in Vagrant. Shared folder enabled through NFS.
#
# I tried to use [dvm](https://github.com/fnichol/dvm) but got issues with
# networking (#4) and shared folder (#7), so I just switched to CoreOS and
# added the settings for it to work like dvm.
# Installing Docker on OSX with Homebrew
brew tap homebrew/binary
brew install docker
# Setup to connect to daemon
echo 'export DOCKER_HOST=192.168.42.43:4243' >> ~/.profile
source ~/.profile
# Cloning and running the CoreOS virtual machine with Vagrant
git clone https://github.com/bmpvieira/coreos-vagrant.git
cd coreos-vagrant
vagrant up
# Pulling an Ubuntu container and running bash with mounted share (optional)
docker pull ubuntu
docker run -i -t -v /home/core/share:/share bash
# You should expect something like this:
# root@3d9e36ea9de5:/# ls /share
# README.md Vagrantfile cluster
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment