It all starts with a container. As we said in Chapter 1, Making the Move – Design, Plan, and Execute, containers are a packetized bundle of software, encapsulated in a standard way. They are units of software that can be run independently, as they are totally self-contained. To make a container, we need to build it.
Remember our description of a container as a process surrounded by its own filesystem. Building a container constructs this filesystem.
To build a container with Docker, we need a definition of its content. The filesystem is created by applying layer after layer. Each Dockerfile, the recipe for generating a container, contains a definition of steps to generate a container.
For example, let's create a very simple Dockerfile. Create a file called example.txt with some example text and another called Dockerfile.simple...