0 votes
in Docker by

List the most commonly used instructions in Dockerfile?

1 Answer

0 votes
by

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.

...