1. 程式人生 > >Mac OSX 安裝Docker

Mac OSX 安裝Docker

I’m working on a couple of blog posts that explain how to use docker on Google Compute Engine. As an appetizer, here’s how I installeddocker 0.8.0 on OSX, the no-brainer way:

First, install Homebrew

If it’s not done already, install Homebrew. You won’t regret it. It is as simple as that:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Install Virtualbox

With Homebrew, it’s trivial to install Virtualbox which is a prerequisite to running docker on OSX:

brew update
brew tap phinze/homebrew-cask
brew install brew-cask
brew cask install virtualbox

Install boot2docker

Boot2docker is a small script that helps download and setup a minimal Linux VM that will be in charge of running docker daemon.

brew install boot2docker
boot2docker init
boot2docker up
export DOCKER_HOST=tcp://localhost:4243

Install docker

brew install docker
docker version

Done!

More information can be found on docker’s official documentationand on boot2docker’s github. It includes, setting up port forwarding, folder sharing, explaining why we need boot2docker…

Now, enjoy!