In the previous chapter, after installing Docker, we pulled an image and created a container from it. Docker's primary objective is running containers. In this chapter, we'll see the different operations we can perform with containers, such as starting, stopping, listing, deleting, and so on. This will help us use Docker for different use cases, such as testing, CI/CD, setting up PaaS, and so on, which we'll cover in later chapters. Before we start, let's verify the Docker installation by running the following command:
$ docker version
This will give the Docker client and server version, as well as other details.
I am using Ubuntu 18.04 as my primary environment in which to run these recipes. They should also work with the other environments.