Day2-1. List out all INSTRUCTION statement of docker and give one line explanation.

FROM – base image to start creating the new image

RUN – Run command in a container created from previous line/layer

ARG – Set a variable for docker file execution and reuse using $(varname)

ENV – Meta layer to set environment for the container

EXPOSE – Sepcify information port for the container and also can be used during port forwarding

COPY – Copy the file in same location as Docker file to container location
ADD – Copy the file in same location as Docker file and extract to destination location in container

USER – default is root user. Can configure which user to run the container

WORKDIR – user work directory

CMD – To set the PID1. This can be replaced while starting the container using “docker run <image name> <process/command>”

ENTRYPOINT – To set the PID1. This can not be replaced while starting. Any parameter passing in docker run will consider parameters for PID1 “docker run <image name> <params>”

VOLUME – The VOLUME command will specify a mount point in the container. This mount point will be mapped to a location on the host that is either specified when the container is created or if not specified chosen automatically from a directory created in /var/lib/docker/volumes