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

  • FROM – Mention a docker image name. Ex: FROM ubuntu
  • MAINTAINER – Mention about the author who create the docker file. Ex: MAINTAINER BittoKC
  • RUN – To execute any command on the container. Ex: RUN touch /tmp/file1.txt
  • ARG – To set an environment variable. Ex: ARG USER1 gehc_security
  • EXPOSE – To specify about the network port that container use at runtime. Ex: EXPOSE 80
  • COPY – To copy files/directories within the file system of docker. Ex: COPY /tmp/file1.txt .
  • ADD –> EXTRACT
  • USER – To set the user for running subsequent commands. Ex: USER ${USER1}
  • CMD – To execute a command while running container. There must be only one CMD in a docker file. If more than, only the last CMD will effect. Ex: CMD touch /tmp/file2.txt
  • ENV – To set an environment variable. Ex: ENV USER2 gehc_security