1.

List the most commonly used instructions in Dockerfile?

Answer»
  • FROM: This is used to set the base image for upcoming instructions. A docker file is considered to be valid if it starts with the FROM instruction.
  • LABEL: This is used for the image ORGANIZATION based on projects, modules, or licensing. It also helps in automation as we specify a key-value pair while DEFINING a label that can be later accessed and handled programmatically.
  • RUN: This command is used to execute instructions following it on the top of the CURRENT image in a NEW layer. Note that with each RUN command execution, we add layers on top of the image and then use that in SUBSEQUENT steps.
  • CMD: This command is used to provide default values of an executing container. In cases of multiple CMD commands the last instruction would be considered.


Discussion

No Comment Found