Chapter 2. Working with Docker Containers
In this chapter, we will cover the following recipes:
- Listing/searching for an image
- Pulling an image
- Listing images
- Starting a container
- Listing containers
- Stopping a container
- Looking at the logs of containers
- Deleting a container
- Setting the restart policy on a container
- Getting privileged access inside a container
- Exposing a port while starting a container
- Accessing the host device inside the container
- Injecting a new process to a running container
- Returning low-level information about a container
- Labeling and filtering containers
Introduction
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 do with containers such as starting, stopping, listing, deleting, and so on. This will help us to use Docker for different use cases such as testing, CI/CD, setting up PaaS, and so on, which...