Create machine-5 minutes a day to play Docker container technology (46)

Source: Internet
Author: User
Tags docker machine

for Docker Machine, the termMachineis the host that runs the Docker daemon. "Create machine" refers to installing and deploying Docker on host. Execute Firstdocker-machine lsTake a look at the current machine

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021446936008261.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021544551020784.jpg "alt=" 220.png "style=" border:0px;vertical-align:middle; "/ >

As we expected, there is no machine at the moment. Next we create the first machine host1-192.168.56.104.

Create machine requires the ability to log on to a remote host without a password, so you need to copy SSH key to 192.168.56.104 with the following command

Ssh-copy-id 192.168.56.104  

Everything's ready. Execute docker-machine create command Create host1

docker-machine Create--driver generic--generic-ip-address=192.168.56.104 host1

  Code style= "Font-family:menlo, Monaco, Consolas, ' Courier New ', monospace;font-size:12.96px;padding:2px 4px;color:rgb (0,0,0); Background:rgb (234,234,235); " >generic   driver Other driver can refer to the document   https://docs.docker.com/ machine/drivers/.

--generic-ip-address   Specifies the IP of the target system and is named   host1 . The command execution procedure is as follows

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447155077165.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021544747026339.jpg "style=" border:0px;float:none; "/>

① Login to the remote host via SSH.
② install Docker.
③ Copy Certificate.
④ Configure Docker daemon.
⑤ start Docker.

re-executes   docker-machine ls  

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447025091870.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021545058039062.jpg "style=" border:0px;float:none; "/>

Can already see the host1. We can log in to host1 to see the specific configuration/etc/systemd/system/docker.service of the Docker daemon.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447152065651.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021545250015235.jpg "style=" border:0px;float:none; "/>

  1. -H tcp://0.0.0.0:2376 make Docker daemon accept remote connections.

  2. --tls* Enable secure authentication and encryption for remote connections.

And we also see that hostname has been set tohost1

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447103097920.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021545462015407.jpg "style=" border:0px;float:none; "/>

Create host2 using the same method

docker-machine Create--driver generic--generic-ip-address=192.168.56.105 host2

after successful creation   docker-machine ls   you can see that both host1 and Host2 are ready

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447197066261.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021545647062517.jpg "style=" border:0px;float:none; "/>

Currently the current environment is as follows

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021447267085122.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021545844047169.jpg "style=" border:0px;float:none; "/>

The next section learns how to manage machine.

650) this.width=650; "Title=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170711-1499780326078042943.png "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20170726-1501021546192066681.jpg "alt=" QR code + fingerprint. png "style=" border:0px;font-family: ' Helvetica Neue ', Helvetica, ' Hiragino Sans GB ', ' Microsoft Yahei ', Arial, sans-serif;font-size:medium; "/>

Create machine-5 minutes a day to play Docker container technology (46)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.