List out all INSTRUCTION statement of dockerfile and give one line explanation.

Limited Time Offer!

For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!

Enroll Now

FROM
Specifies the base image. Specified docker image will be downloaded from registry if locally not available.
Eg: FROM ubuntu

MAINTAINER
Specifies the meta data about the user who creates.

LABEL
Specifies meta data about the image. It will be in key value pair format
Eg: LABEL “Application_Environment”=”Development”
LABEL “Application_Support”=”LearnITGuide.net Group”

EXPOSE
Expose instruction is used to inform about the network port the container listens on runtime.

Eg: EXPOSE 80 443
EXPOSE 80/tcp 8080/udp

ADD
The instruction helps to copy files, directories and remote URL files to destination. If the source is in compressed format, then it will be extracted to the destination folder.
Eg: ADD /root/testfile /data/

COPY
Copy is similar to ADD. Difference is it wont extract the source compressed file. It will just copy the source.
Eg: COPY /root/testfile /data/

RUN
Run command will execute any commands on the top of the current image and will create a new layer.
Eg: RUN yum update
RUN systemctl start httpd

ENTRYPOINT & CMD
Both are used to set PID


ARG
To set the environment variables. But this will be set only during image not on container.