运行安装文件,将会安装Virtualbox、MSYS-git boot2Docker Linux 镜像和Boot2Docker的管理工具
注意:软件安装时会自动检测已安装的软件,简单粗暴,直接下一步。
安装完成双击运行桌面 Boot2Docker Start
,打开命令行终端,待初始化完成,需要注意虚拟主机IP地址
IP address of docker VM:
192.168.59.103
执行 docker version
命令来查看它是否正常工作
dadei@LAPTOP-EC9EOSHE MINGW64 ~
$ docker version
Client:
Version: 1.8.0
API version: 1.20
Go version: go1.4.2
Git commit: 0d03096
Built: Tue Aug 11 17:17:40 UTC 2015
OS/Arch: windows/amd64
Server:
Version: 1.8.0
API version: 1.20
Go version: go1.4.2
Git commit: 0d03096
Built: Tue Aug 11 17:17:40 UTC 2015
OS/Arch: linux/amd64
执行 boot2docker.exe ssh
命令 连接到虚拟主机
dadei@LAPTOP-EC9EOSHE MINGW64 ~
$ boot2docker.exe ssh
## .
## ## ## ==
## ## ## ## ## ===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o __/
\ \ __/
\____\_______/
_ _ ____ _ _
| |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __
| '_ \ / _ \ / _ \| __| __) / _` |/ _ \ / __| |/ / _ \ '__|
| |_) | (_) | (_) | |_ / __/ (_| | (_) | (__| < __/ |
|_.__/ \___/ \___/ \__|_____\__,_|\___/ \___|_|\_\___|_|
Boot2Docker version 1.8.0, build master : 7f12e95 - Tue Aug 11 17:55:16 UTC 2015
Docker version 1.8.0, build 0d03096
docker@boot2docker:~$ docker run hellp-world
Unable to find image 'hellp-world:latest' locally
Pulling repository docker.io/library/hellp-world
Error: image library/hellp-world:latest not found
执行 docker run -p 80:80 -d nginx
命令启动Nginx
docker@boot2docker:~$ docker run -p 80:80 -d nginx
9dfd237142eb4f0f0a45ceb152d26c25c2564f5ef1994ecf8a42ec87b939d086
执行 docker ps -a
命令查看启动服务状态
docker@boot2docker:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9dfd237142eb nginx "/docker-entrypoint.s" 3 minutes ago Up 3 minutes 0.0.0.0:80->80/tcp agitated_tesla