1 Before you begin
Docker packages applications into lightweight, portable containers that run consistently across laptops, data centers, and clouds. The technology is widely adopted and valued for its simplicity and impact, and this book takes a practical, hands-on path that gets complete beginners running containers quickly. This opening chapter sets the stage by explaining why containers matter, how they solve real problems, and what learning approach the book uses so readers can judge if it matches their goals.
Real-world use cases center on five themes. For cloud migration, containers provide a third path beyond IaaS and PaaS, combining portability with efficient, standardized operations, usually without changing application code—just packaging with Dockerfiles and application manifests. Legacy systems can be modernized incrementally by first containerizing a monolith and then carving out features into separate services that communicate over private container networks, gaining faster releases, independent scaling, and technology flexibility. New cloud‑native apps embrace microservices where each component runs in its own container and can be built, tested, and composed uniformly, with third‑party services easily pulled in from container registries. Containers also underpin emerging models like serverless and support domains such as machine learning and IoT, enabling one platform to run diverse workloads. Finally, Docker accelerates DevOps by unifying tools and processes across development and operations, aligning well with CALMS principles to boost automation, flow, measurement, and sharing.
The book is for readers who want to apply Docker to real problems, emphasizing practical usage over internals, with cross‑platform samples that work on Windows, macOS, and Linux (including Arm). Kubernetes appears later as the common way to run containers in production, building on the same skills learned here. To follow along, set up a local lab by installing Docker (Desktop or alternatives), verify Docker and Compose are working, obtain the sample source code, and use simple cleanup commands as you progress so your environment stays tidy.
The original options for migrating to the cloud—use IaaS and run lots of inefficient VMs with high monthly costs, or use PaaS and get lower running costs but spend more time on the migration.

The same app, migrated to Docker before moving to the cloud. This application has the cost benefits of PaaS with the portability benefits of IaaS and the ease of use you get only with Docker.

Decomposing a monolith into a distributed application without rewriting the whole project. All the components run in Docker containers, and a routing component decides whether requests are fulfilled by the monolith or a new microservice.

Cloud-native applications are built with microservice architectures where every component runs in a container.

A single cluster of servers running Docker can run every type of application, and you build, deploy, and manage them all in the same way no matter what architecture or technology stack they use.

Being immediately effective
“Immediately effective” is another principle of the Month of Lunches series. In all the chapters that follow, the focus is on learning skills and putting them into practice.
Every chapter starts with a short introduction to the topic, followed by try-it-now exercises where you put the ideas into practice using Docker. Then there’s a recap with some more detail that fills in some of the questions you may have from diving in. Lastly, there’s a hands-on lab for you to go to the next stage.
All the topics center around tasks that are genuinely useful in the real world. You’ll learn how to be immediately effective with the topic during the chapter, and you’ll finish by understanding how to apply the new skill. Let’s start running some containers!