List out all INSTRUCTION statement of dockerfile and give one line explanation. – Draft
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
Dockerfile commands
DOCKER file Commands | Details | |
1 | FROM | Taking the base image |
2 | MAINTAINER | Creater of the dockerfile |
3 | RUN | Run command in the container of the previous layer |
4 | ARG | Set a variable for the dockerfile and reuse it ${var}. Scope is only during the building process. |
5 | EXPOSE | Specifying information port for the container |
6 | COPY | Copy the files to the image |
7 | ADD/EXTRACT | Extract + Copy compressed files to the image |
8 | USER | Set a container the runtime user. |
9 | CMD | To set PID 1 |
10 | ENTRYPOINT | To set PID 1 |
11 | ENV | For setting the environment variable in the container. |
12 | VOLUME | Create or mount a volume to the docker contanier from the docker host file system. |
13 | WORKDIR | Sets the working directory or context inside the image we are building. |
14 | ONBUILD | For specifying the command to run when the image in the docker file is used as the base image for another docker image. |