mac下安装docker

步骤一: 安装 VirtualBox

用 brew-cask 安装 virtual box

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

步骤二: 安装 Docker 与 boot2docker

$ brew update
$ brew install docker
$ brew install boot2docker

步骤三: 初始化并启动boot2docker

$ boot2docker init
$ boot2docker up

步骤四: 设置docker环境变量

注意每个人的配置可能会有所不同

To connect the Docker client to the Docker daemon, please set:
    export DOCKER_CERT_PATH=/Users/ZoOL/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    export DOCKER_HOST=tcp://192.168.59.103:2376

步骤五: 测试

$ docker info

Containers: 0
Images: 0
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Dirs: 0
Execution Driver: native-0.2
Kernel Version: 3.16.7-tinycore64
Operating System: Boot2Docker 1.4.1 (TCL 5.4); master : 86f7ec8 - Tue Dec 16 23:11:29 UTC 2014
CPUs: 8
Total Memory: 1.961 GiB
Name: boot2docker
ID: T4Z4:5EIE:6543:M53Y:YNN7:WMGE:UTZI:PUCR:ERDA:HQEB:U5RL:B5CA
Debug mode (server): true
Debug mode (client): false
Fds: 10
Goroutines: 11
EventsListeners: 0
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker

安装完成

comments powered by Disqus