Learning about using the command line to work with containers
In this section, we will learn how to manage containers. We will use the Docker command line, provided by the Docker client (the docker-client
package or WSL integrated into Docker Desktop environments). All the command-line actions we are going to discuss in this chapter will be similar for other clients, such as nerdctl
or podman
, although in the latter case, it does not use a containerd
daemon.
The Docker client sends actions to the Docker daemon via an API every time we retrieve information about Docker objects. Clients can use SSH, HTTP/HTTPS, or direct sockets (or pipes in Microsoft operating systems).
First, we will start with the actions that are common and available to all container runtime objects:
create
: All the container runtime objects can be created and destroyed. This doesn’t apply to container images because we will usedocker image build
to start a building process to create them. All...