โ Back to Docker and containers
๐ฆ Docker and containers: cheat sheet
๐จ The analogyShipping containers: pack the thing and everything it needs into one standard box that every ship handles the same way.
๐ The regular explanationPackaging an app with everything it needs (runtime, libraries, config) into an image that runs the same everywhere as an isolated container sharing the host's kernel.
- You build something in your workshop. It works perfectly there, with your tools and your parts.
- You send loose parts to two ships. One has different tools on board, so it can't put it together.
- The other ship differs in some small way you didn't notice. Each ship is a surprise.
- You pack the thing and everything it needs, tools and parts included, into one standard shipping container.
- The container goes to the yard, where anyone can collect an identical copy.
- Every ship carries the same box the same way. Whatever's inside, it works the same on every ship.
- One ship carries many boxes. Each box has its own contents, and none can see into the others.
- All the boxes share the one hull, which is why they're light and quick to load compared with sending a whole ship each.
- Each box is only allowed so much space and weight, so one heavy box can't sink the others.
๐งฉ Key questions
- Why did the loose parts work in your workshop but not on every ship?
- Each ship had different tools, or was missing a part you didn't know you needed. Every ship was a surprise, because the thing didn't travel with what it needs.
- What goes into the standard shipping container?
- The thing and everything it needs. Any ship can collect an identical copy and carry it the same way.
- Why are many boxes on one ship lighter than a ship each?
- Because they share one hull, while staying shut off from each other. None can see into the others, and each has a weight limit.