tool box在Mac下安装Docker(用Boot2Docker来使用Docker)

Windows下安装Docker,参见:使用Boot2Docker来使用Docker(toolbox在Windows下安装Docker)

在linux上安装, the Docker client, the Docker daemon, and any containers 会执行运行在本机上. 这意味着可以Docker container 可以使用直接使用本地地址,例如localhost:8000 、0.0.0.0:8376。

blog20150922094509

In an OS X installation, the docker daemon is running inside a Linux VM called default. The default is a lightweight Linux VM made specifically to run the Docker daemon on Mac OS X. The VM runs completely from RAM, is a small ~24MB download, and boots in approximately 5s. 和windows类似,Docker 在mac os x也是借助linux虚拟机来运行的。

blog20150922110515

 

安装

去https://www.docker.com/toolbox下载mac版

blog20150922093435

或者去https://github.com/boot2docker/osx-installer/releases下载

安装截图:

blog20150922094914 blog20150922095111 blog20150922095131 blog20150922095207 blog20150922095224

比windows下安装快多了。

the Docker Quickstart Terminal

在launchPad里运行Quickstart,
Creating Machine default...
Creating CA: /Users/ganl/.docker/machine/certs/ca.pem
Creating client certificate: /Users/ganl/.docker/machine/certs/cert.pem
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env default
Starting machine default...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Setting environment variables for machine default...

## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

ganl:~ ganl$

blog20150922105529

为什么IP都和windows一样:192.168.99.100

连接Docker主机:
ganl:~ ganl$ ssh docker@192.168.99.100
The authenticity of host '192.168.99.100 (192.168.99.100)' can't be established.
RSA key fingerprint is bf:61:58:f1:e4:fa:d7:aa:30:11:6c:38:8c:37:c0:e7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.99.100' (RSA) to the list of known hosts.
docker@192.168.99.100's password:
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
_ _ ____ _ _
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.8.2, build master : aba6192 - Thu Sep 10 20:58:17 UTC 2015
Docker version 1.8.2, build 0a8c2e3
docker@default:~$

拉取,查看,运行镜像:
docker@default:~$ docker pull daocloud.io/library/ubuntu:14.04
Pulling repository daocloud.io/library/ubuntu
91e54dfb1179: Download complete
d3a1f33e8a5a: Download complete
c22013c84729: Download complete
d74508fb6632: Download complete
Status: Downloaded newer image for daocloud.io/library/ubuntu:14.04
docker@default:~$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
daocloud.io/library/ubuntu 14.04 91e54dfb1179 4 weeks ago 188.4 MB
docker@default:~$ docker run -i -t daocloud.io/library/ubuntu:14.04 /bin/bash
root@f229f2406660:/# cat /etc/issue
Ubuntu 14.04.3 LTS \n \l

root@f229f2406660:/#

docker官方安装文档:https://docs.docker.com/installation/mac/

Installation on Mac OS X

未经允许不得转载:ganlei的个人博客 » tool box在Mac下安装Docker(用Boot2Docker来使用Docker)

赞 (2)
分享到:更多 ()