Introduction to Dockerfile and common reserved instructions

Starting from this article, we will introduce another technical point of docker: dockerfile. Let's take a look at the knowledge points related to DockerFile. How will we learn?

1: What is DockerFile?

2: DockerFile build process analysis

3: Commonly used reserved word instructions

4: Case and small summary. As shown below:

What is dockerFile?

DockerFile is a text file used to build a Docker image. It is a script composed of instructions and parameters required to build an image.

dockerFile working diagram:

Build steps:

Write DockerFile file>>docker build command to build image>>docker run image operation

DockerFile build process

1: Basic knowledge of DockerFile content

a. Each reserved word instruction must be an uppercase letter followed by at least one parameter

b. Instructions are executed in order from top to bottom

c, # means comment

d. Each instruction will create a new image layer and submit the image

Dcoker executes the general process of DockerFile

1: docker runs a container from the base image

2: Execute an instruction and make changes to the container

3: Perform an operation similar to docker commit to submit a new image layer

4: docker runs a new container based on the image just submitted

5: execute dockerF

Guess you like

Origin blog.csdn.net/kaizi_1992/article/details/128416748