Chapter Five · Part 2: The Toolchain

Containers

Code that runs on Maya's laptop has a way of breaking the moment it lands on Sam's server — same code, different surroundings. Containers are the fix: a way to package an app with everything it needs so it behaves the same everywhere. This chapter is the idea behind every "it runs anywhere" promise in modern software.

3 topics

So far Pageturn's code has been written, versioned, and tested. But there's a problem we've been quietly stepping around: code that works in one place doesn't always work in another. Move it from the machine where it was written to the machine where it has to run, and it can fall apart — not because anyone changed the code, but because the two machines are subtly different. This is one of the oldest, most maddening problems in software, and this chapter is about the thing built to solve it.

Three short topics walk the full arc. First, the problem itself — "works on my machine," where identical code behaves differently in two places, and why that happens. Then the fix: a container, which packages the app together with everything it needs so it runs the same anywhere. And finally two words that confuse nearly everyone at first — image and container — and how they relate. By the end you'll know what gets built, what gets shipped, and what gets run.

The chapter in three steps: the problem, the fix, and the vocabulary
The problem
"Works on my machine." The same code runs on Maya's laptop and breaks on Sam's server, because the surroundings differ.
The fix
A container. The app is packaged with its tools and settings, so the environment travels with it and every machine agrees.
The vocabulary
Image vs container. The image is the sealed package; a container is that package actually running. One image, many copies.

Topics in This Chapter