Docker
The container runtime that defined modern packaging. Build once, run anywhere — for real.
Mindmap
The plain-English version
Docker packages applications into containers — bundles of code, libraries, and OS pieces — that run identically anywhere. The image (static blueprint) is built from a Dockerfile and stored in a registry; the container (running instance) starts from the image. Docker the company commercialized container tech around 2013 and shaped the modern build/ship/run flow.
The problem it solves
Containers solved "works on my machine." The same image runs on a developer laptop, a CI runner, and a production cluster — byte-identical. They're the unit Kubernetes orchestrates. Even if you never run a Dockerfile yourself, your CI/CD probably does.
Alternatives
| Alternative | Type | When it wins |
|---|---|---|
| Kubernetes | orchestrator | The container orchestrator. Powerful, complex, the de facto standard for running containers at scale. |
Deep links
The words you'll hear
- Dockerfile
- The recipe. Text file with build instructions.
- Image
- Static read-only artifact built from a Dockerfile.
- Container
- Running instance of an image.
- Layer
- Each Dockerfile instruction creates a layer. Cached and reused on rebuild.
- Registry
- Where images live. Docker Hub, GitHub Container Registry (ghcr.io), AWS ECR, Cloudflare R2.
- Multi-stage build
- Build in one stage with full toolchain; copy only the artifact to a slim runtime stage. Smaller images.
- Compose
- Local multi-container orchestration with YAML. Great for dev, not for production.
Bad vs. good prompt for Docker
Why it works: Specifies multi-stage (the right pattern), security (non-root), operational hygiene (healthcheck), size budget, and the often-missed .dockerignore. Teaches the agent to ship a real-world Dockerfile, not the bare-minimum one.
What bites real teams
The default. A container compromise becomes a host concern. Use USER appuser in your Dockerfile.
Forgetting multi-stage means you ship the build toolchain to production. 1GB images become 150MB with multi-stage.
Putting COPY . . before npm ci invalidates the dependency cache on every commit. Order layers from least-to-most-changing.