Running Docker Containers
Containers in Docker are considered ephemeral environments where executables are run, and no state is kept. This is partially true, since the data generated inside the container is only available in the same container. However, Docker Engine provides methods that allow you to share data between the host system and containers. In addition, the services inside the containers are reachable between the host system and other containers.
In this section, we will explain how to run Docker containers using volume and port mapping in order to show how containers are used for stateful services. Running a container starts by running processes, which are packaged as Docker images, as isolated containers. This could be initiated by the docker run command, or programmatically by using the Docker API on local or remote host systems. Docker Engine provides more than just running processes and it can attach networks or volumes, ensure runtime constraints on resources, or add Linux...