Working with Dockerfiles
Before starting to work with Dockerfiles, let’s see what a Dockerfile is. It is a text file that consists of instructions defined by the user for Docker to execute, and respecting some basic structure, such as the following:
INSTRUCTION arguments
The Dockerfile is mainly used for creating new container images. This file is used by Docker to automatically build images based on the information the user provides inside the file. There are some keywords that define a Dockerfile. Those keywords, which are referred to as instructions, are as follows:
FROM
: This must be the first instruction inside a Dockerfile as it tells Docker what the image is that you build uponLABEL
: This instruction adds some more information, such as a description, or anything that could help describe the new image you are creating; the use of such instructions needs to be limitedRUN
: This is the instruction that offers direct interaction with the image, the place...