In the previous chapter, we talked about source code management with Git, where we took a crash course on Git and then discussed GitOps and how it shapes modern DevOps practices.
In this chapter, we’ll get hands-on and explore Docker – the de facto container runtime. By the end of this chapter, you should be able to install and configure Docker, run your first container, and then monitor it. This chapter will also form the basis for the following chapters, as we will use the same setup for the demos later.
In this chapter, we’re going to cover the following main topics:
- Installing tools
- Installing Docker
- Introducing Docker storage drivers and volumes
- Running your first container
- Docker logging and logging drivers
- Docker monitoring with Prometheus
- Declarative container management with Docker Compose
Technical requirements
For this chapter, you will need a Linux machine running Ubuntu 18.04 Bionic LTS or later with sudo access. We will be using Ubuntu 22.04 Jammy Jellyfish for the entirety of this book, but feel free to use any OS of your choice. I will post links to alternative installation instructions.
You will also need to clone the following GitHub repository for some of the exercises: https:// github.com/PacktPublishing/Modern-DevOps-Practices-2e.
We discussed Git extensively in the previous chapter; therefore, you can easily clone the repository using that knowledge. Now, let’s move on to installing Docker on your machine.