Dockerfile
A Dockerfile is essentially a text file with a predetermined structure that contains a set of instructions for building a Docker image. The instructions in the Dockerfile specify what base image to start with (for example, Ubuntu 20.04), what software to install, and how to configure the image. The purpose of a Dockerfile is to automate the process of building a Docker image so that the image can be easily reproduced and distributed.
The structure of a Dockerfile is a list of commands (one per line) that Docker (containerd
to be exact) uses to build an image. Each command creates a new layer in the image in UnionFS, and the resulting image is the union of all the layers. The fewer layers we manage to create, the smaller the resulting image.
The most frequently used commands in a Dockerfile are the following:
FROM
COPY
ADD
EXPOSE
CMD
ENTRYPOINT
RUN
LABEL
ENV
ARG
VOLUME
USER
WORKDIR
You can find a complete...