Skip to content

Instantly share code, notes, and snippets.

@vemuruadi
Created June 3, 2019 08:18
Show Gist options
  • Save vemuruadi/3c1c88c75623ded9f788ca92e309547e to your computer and use it in GitHub Desktop.
Save vemuruadi/3c1c88c75623ded9f788ca92e309547e to your computer and use it in GitHub Desktop.
FROM — specifies the base (parent) image.
LABEL —provides metadata. Good place to include maintainer info.
ENV — sets a persistent environment variable.
RUN —runs a command and creates an image layer. Used to install packages into containers.
COPY — copies files and directories to the container.
ADD — copies files and directories to the container. Can upack local .tar files.
CMD — provides a command and arguments for an executing container. Parameters can be overridden. There can be only one CMD.
WORKDIR — sets the working directory for the instructions that follow.
ARG — defines a variable to pass to Docker at build-time.
ENTRYPOINT — provides command and arguments for an executing container. Arguments persist. 
EXPOSE — exposes a port.
VOLUME — creates a directory mount point to access and store persistent data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment