Docker
easy 26 minDocker packages a program with its files into an image and runs it as an isolated process called a container.
When it comes up
The moments this idea belongs in a design interview, and the moments it does not.
Signals
When it comes up
| You hear | Say | Because |
|---|---|---|
| Works here, not there | One image through all environments | The same bytes everywhere |
| Many small services | Containers, then an orchestrator | Own dependencies, dense packing |
| Builds take ten minutes | Order layers, cache, multi-stage | Only changed steps run |
| Run customers' code | MicroVMs around it | A shared kernel is a thin wall |
| Keep the uploads | Object storage or a volume | The writable layer is temporary |
| Deploy in seconds | Small images, shared layers | Only missing layers travel |
Options
Explain your choices
Twelve services must run in production. What runs the containers?
Breaksdocker run on one big server
- How
- A script starts all twelve.
- Limit
- One host is one failure, and nobody replaces a hung container or rolls out gradually.
- Choose when
- A demo.
WorksCompose on two hosts behind a load balancer
- How
- The same file on both, deployed one after the other.
- Limit
- No automatic healing between hosts, manual capacity, state needs its own plan.
- Choose when
- A small team with steady load.
StrongA managed orchestrator
- How
- A managed Kubernetes or container service with health checks, rolling updates and limits; databases outside.
- Limit
- More concepts and cost; someone must own it.
- Choose when
- Several teams, changing load, an availability target.