網頁

2020/5/1

Docker Machine 啟動machine start docker machine

使用Docker Machine啟動machine的方法如下。

範立環境:

  • Windows 7 64Bit
  • Docker Machine version 0.16.1, build cce350d7
  • Oracle VirtualBox 版本 5.2.20 r125813 (Qt5.6.2)

注意:本範例的Docker Machine及VirtualBox是由Docker Toolbox安裝


使用docker-machine ls查詢目前可用的machine列表。

C:\>docker-machine ls
NAME          ACTIVE   DRIVER       STATE     URL                         SWARM  DOCKER     ERRORS
default       -        virtualbox   Stopped                                      Unknown
demo-docker   -        virtualbox   Running   tcp://192.168.99.101:2376          v19.03.5

defualt的狀態是停止中(Stopped)。

docker-machine start <machine-name>可啟動指定的machine,<machine-name>為machine名稱。

所以用docker-machine start defualt啟動default。

C:\>docker-machine start default
Starting "default"...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...
Machine "default" was started.
Waiting for SSH to be available...
Detecting the provisioner...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

再次查詢狀態可看到default狀態為運行中(Running)。

C:\>docker-machine ls
NAME          ACTIVE   DRIVER       STATE     URL                         SWARM  DOCKER     ERRORS
default       *        virtualbox   Running   tcp://192.168.99.100:2376          v19.03.5
demo-docker   -        virtualbox   Running   tcp://192.168.99.101:2376          v19.03.5

沒有留言:

張貼留言