Docker can build images automatically by reading the instructions provided in a Dockerfile, a document that contains all the commands that are invoked on the command line to assemble an image. All of those commands have to be preceded by the keywords defined in the Dockerfile specification. The following is a list of the most commonly used instructions. They are executed in the order in which they are found in the Dockerfile. Here, we can also append some comments that have to be followed by the # character:
Instruction |
Description |
FROM |
This initializes a new build stage and sets the base image for subsequent instructions. In fact, every valid Dockerfile has to start with a FROM instruction. |
MAINTAINER |