"Vmcloud Cloud Platform" embracing Docker (vi) about Dockerfile (3) example

Source: Internet
Author: User

In the previous two, we talked about most of the parameters, today will introduce the other two more important parameters, and then the previous two chapters of the knowledge string up, do a dockerfile, to achieve vim/ssh image.

Here's what we're going to say about the dockerfile environment today:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps11ea.tmp "border=" 0 "alt=" wps11ea.tmp "src=" http://s3.51cto.com/wyfs02/M02/85/2B/ Wkiol1ebxtwatrdvaabt0f9durm961.jpg "width=" 549 "height=" 407 "/>,

Dockerfile Simple:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps11fb.tmp "border=" 0 "alt=" wps11fb.tmp "src=" http://s3.51cto.com/wyfs02/M00/85/2B/ Wkiol1ebxtnsojehaabll-3fors446.jpg "width=" 238 "height=" 484 "/>

1, volume parameters: Read our introduction volume The students should know volume This parameter is used to do what, here do not introduce, if not specified in the Dockerfile, can be specified by-V, of course, the two are different, For details, refer to the fifth chapter of the Docker article.

2, workdir parameter: Use this parameter can specify "Run directory", for example you need a command to run under/bin/bash, then directly specify Workdir/bin/bash, the command most often with the use of run.

3, add parameter : This parameter is used to copy the local file or remote file to the built image, when creating container, will be copied in, to use this parameter need to copy the relevant files in advance to the same directory with dockerfile or use the URL (accessible).

4, OK, chat so much, we use a complete Dockerfile file for example:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps11fc.tmp "border=" 0 "alt=" wps11fc.tmp "src=" http://s3.51cto.com/wyfs02/M01/85/2B/ Wkiol1ebxtraior5aacu9oyvcjc236.jpg "width=" 441 "height=" 484 "/>

5, complete dockerfile writing, this dockerfile is mainly to achieve the ability to ssh directly into this container and to use the VIM editor, we use this dockerfile build images:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps120c.tmp "border=" 0 "alt=" wps120c.tmp "src=" http://s3.51cto.com/wyfs02/M00/85/2B/ Wkiol1ebxtuhwsjfaabiggxq6d8332.jpg "width=" 365 "height=" 124 "/>

650) this.width=650; "Style=" background-image:none;margin:0px;padding-left:0px;padding-right:0px; border-top-width:0px;border-bottom-width:0px;border-left-width:0px;padding-top:0px; "title=" Wps120D.tmp "border= "0" alt= "wps120d.tmp" src= "http://s3.51cto.com/wyfs02/M02/85/2B/wKioL1ebXTywVkBCAABAc9B6Vqo032.jpg" width= "461" height= "108"/>

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps121e.tmp "border=" 0 "alt=" wps121e.tmp "src=" http://s3.51cto.com/wyfs02/M01/85/2B/ Wkiol1ebxtzc22fqaaesnysupmc669.jpg "width=" 327 "height=" 484 "/>

6. We use this image to build a container:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps121f.tmp "border=" 0 "alt=" wps121f.tmp "src=" http://s3.51cto.com/wyfs02/M02/85/2B/ Wkiol1ebxt3x1nmfaaayqa7ls2a830.jpg "width=" 644 "height=" "/>"

7, direct SSH The container, success:

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px; "title=" wps1220.tmp "border=" 0 "alt=" wps1220.tmp "src=" http://s3.51cto.com/wyfs02/M00/85/2B/ Wkiol1ebxt7cwww3aaa_phv96vy203.jpg "width=" 444 "height=" 168 "/>

650) this.width=650; "Style=" background-image:none;padding-left:0px;padding-right:0px;float:none; Border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto; padding-top:0px, "title=" logo "border=" 0 "alt=" logo "src=" http://s3.51cto.com/wyfs02/M01/85/2B/ Wkiom1ebxt-xq1xlaaeab8so6zk019.png "width=" 530 "height=" 347 "/>

This article from "Vmcloud" blog, declined reprint!

"Vmcloud Cloud Platform" embracing Docker (vi) about Dockerfile (3) example

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.