In the previous chapter, we learned a lot about how container networking works on a single Docker host. We introduced the Container Network Model (CNM), which forms the basis of all networking between Docker containers, and then we dove deep into different implementations of the CNM, specifically the bridge network.
This chapter introduces the concept of an application consisting of multiple services, each running in a container, and how Docker Compose allows us to easily build, run, and scale such an application using a declarative approach.
The chapter covers the following topics:
- Demystifying declarative versus imperative
- Running a multi-service application
- Scaling a service
- Building and pushing an application
After completing this chapter, the reader will be able to do the following:
- Explain in a few short sentences the main differences between an imperative and declarative approach for defining and running an application
- Describe in their own words the difference between a container and a Docker Compose service
- Author a Docker Compose YAML file for a simple multi-service application
- Build, push, deploy, and tear down a simple multi-service application using Docker Compose
- Use Docker Compose to scale an application service up and down