Answers
Here are some sample answers to the questions presented in this chapter:
- Linux had to first introduce namespaces and cgroups to make containers possible. Containers use those two concepts extensively. Namespaces are used to encapsulate and thus protect resources defined and/or running inside a container. cgroups are used to limit the resources processes running inside a container can use, such as memory, bandwidth, or CPU.
- The possible states of a Docker container are as follows:
created
: A container that has been created but not startedrestarting
: A container that is in the process of being restartedrunning
: A currently running containerpaused
: A container whose processes have been pausedexited
: A container that ran and completeddead
: A container that Docker Engine tried and failed to stop
- We can use the following (or the old, shorter version,
docker ps
):$ docker container ls
This is used to list all containers that are currently running on our Docker...