Suresh Payankannur

Friday, January 9, 2015

Docker and MacOS using Brew

Docker is an very light-weight Linux Container (LXC) management and configuration tool. One can very quickly spin, configure and provision VMs using Docker.

Install Docker

To install Docker on a MacOS, using Brew:
  1. Install Cask
  2. Install VirtualBox
  3. Install Docker
brew update &&  brew upgrade
brew install caskroom/cask/brew-cask
brew cask install virtualbox
brew install docker
brew install boot2docker
boot2docker init

Run Docker

boot2docker up
This will give the IP and Socket of the Docker daemon. For example:
    export DOCKER_HOST=tcp://192.168.2.103:2376
    export DOCKER_CERT_PATH=/Users/johndoe/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1

Use Docker

On another terminal, setup the environment variables and spin off a VM
export DOCKER_HOST=tcp://192.168.2.103:2376
export DOCKER_CERT_PATH=/Users/johndoe/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1

docker images
docker run hello-world
docker run -it ubuntu bash

Shut down Docker

boot2docker down

0 comments:

Post a Comment

Blog Archive

Scroll To Top