FROMinstruction initializes a new build stage and sets the Base Image for subsequent instructions. As such, a valid Dockerfile must start with a
FROMinstruction. The image can be any valid image
ENVinstruction sets the environment variable
RUNinstruction will execute any commands in a new layer on top of the current image and commit the results. The resulting committed image will be used for the next step in the
LABELinstruction adds metadata to an image. A
LABELis a key-value pair. To include spaces within a
LABELvalue, use quotes and backslashes as you would in command-line parsing.
EXPOSEinstruction informs Docker that the container listens on the specified network ports at runtime. You can specify whether the port listens on TCP or UDP, and the default is TCP if the protocol is not specified.
COPYinstruction copies new files or directories from
<src>and adds them to the filesystem of the container at the path
WORKDIRinstruction sets the working directory for any
ADDinstructions that follow it in the
Dockerfile. If the
WORKDIRdoesn’t exist, it will be created even if it’s not used in any subsequent
ENTRYPOINTin combination with
COPYfor instance, all subsequent instructions must be re-run.