Original link: https://my.oschina.net/u/2612999/blog/1036388 Summary: Dockerfile best Practices
While Dockerfile simplifies the process of mirroring building, and it can be versioned, improper Dockerfile use can also cause many problems: The Docker
dockerfile File
Dockerfile uses a DSL -based directive to build a Docker image, and then uses the Docker build command to build a new image based on the Dockerfile directive.
About the DSL language, Bo Master carefully consulted, interested can
Dockerfile is a text-formatted configuration file that allows users to quickly create custom images using Dockerfile.
I. BASIC structure of dockerfileDockerfile consists of a row of line command statements and supports comment lines that begin with #
Dockerfile features and their workflowDocker can create an image by automatically reading the Dockerfile file, Dockerfile is a text document type, where all the actions commands that the user can make at the command line can be defined here,
Original source: http://blog.csdn.net/anxpp/article/details/52495309
Dockerfile is a text-formatted configuration file that we can use to quickly create a custom image using the Dockerfile file.
Many of the instructions supported by Dockerfile are
The command used in Dockerfile has a base image specified from the from from, and in general a usable dockerfile must be from for the first instruction.
As for the image, it can be any image image that is reasonably present.
The from must be
First, the following commands, such as Run, CMD, and entrypoint, can be used to execute commands, but each has different characteristics.
Run is executed at the time of build image.
The CMD entrypoint is executed when the image is run.
We can download the image from the official repository from the Docker hub, and I downloaded the Ubuntu image myself, just 188M about, very small. But looked down, the inside of the software source is still official, and is not installed vim , so it
Transferred from: http://blog.163.com/digoal@126/blog/static/163877040201410411715832/
When creating an image using Dockerfile, there are several instructions that are easier to confuse, RUN, CMD, EntryPoint. Run is an instruction that runs at
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
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.