Building an image:
To be able to automate the building of a docker image, we use a Dockerfile. The dockerfile contains all the necessary instruction to build an image.
- The base operating system image (Ubuntu, debian, ...).
- Instructions to install the applications -we want to run in the container- and their dependencies.
- All the files that the application might need.
- Networking information ( port of the application, ...).
- Set of commands that we want the container to run at "boot" time.
Below, is a dockerfile simple example: