A Dockerfile specifies instructions on how to create an image.
A Dockerfile describes the software that is “baked” into an image. It isn’t just ingredients though, it can tell the software what environment to use or what commands to run.
from ...
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "vim"]
When developing a dockerfile, some docker instruction will create layers (also known as commit)
With multi-stage builds, you use multiple FROM statements in your Dockerfile.
If you use Docker 17.05 or higher, you can use multi-stage builds to drastically reduce the size of your final image
Your build stage may contain several layers, ordered from the less frequently changed to the more frequently changed for example:
RUN apt-get update && apt-get install -y \
bzr \
cvs \
git \
mercurial \
subversion