Docker-Machine

做为Docker容器集群管理三剑客之一的Docker Machine大大简化了Docker主机部署的复杂度,极大的方便了开发者管理分布式Docker环境。

创建本地主机实例

使用virtualbox类型的驱动,创建一台Docker主机,命名为qa。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ docker-machine.exe create -d virtualbox qa
Running pre-create checks...
Creating machine...
(qa) Copying C:\Users\youfei.hu\.docker\machine\cache\boot2docker.iso to C:\Users\youfei.hu\.docker\mach ine\machines\qa\boot2docker.iso...
(qa) Creating VirtualBox VM...
(qa) Creating SSH key...
(qa) Starting the VM...
(qa) Check network to re-create if needed...
(qa) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation windo w is minimized in the taskbar.
(qa) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: C:\Program Files\Docker Toolbox\docker-machine.exe env qa

验证创建成功

1
2
3
4
5
$ docker-machine.exe ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
default - virtualbox Running tcp://192.168.99.100:2376 v17.09.1-ce
qa - virtualbox Running tcp://192.168.99.102:2376 v17.09.1-ce
test - virtualbox Running tcp://192.168.99.101:2376 v17.09.1-ce

唐胡璐 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!
分享创造价值,您的支持将鼓励我继续前行!