containerd vs Docker
Understand the relationship between containerd and Docker, their differences, and when to use each. This guide clarifies the confusion around these two container technologies.
The fundamental difference is that containerd is a container runtime while Docker is a complete container platform. containerd focuses solely on running containers; Docker includes containerd plus additional features like image building, a CLI, Docker Compose, and a REST API.
Think of it this way: containerd is the engine, Docker is the entire car. Docker uses containerd under the hood to manage containers, but adds many developer-friendly features on top. Since Docker 1.11, Docker Engine has used containerd as its underlying runtime.
CLI | REST API | Compose | Build | Swarm
Docker Engine is composed of several components, and containerd is one of them. Here's the architecture:
Docker Architecture
┌─────────────────────────────────────────────────────────┐
│ Docker CLI │
│ (docker run, docker build, etc.) │
└─────────────────────────┬───────────────────────────────┘
│ REST API
┌─────────────────────────▼───────────────────────────────┐
│ Docker Engine │
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────┐ │
│ │ BuildKit │ │ Swarm │ │ Docker Compose │ │
│ └─────────────┘ └─────────────┘ └─────────────────┘ │
│ │ │
│ containerd │
│ (container lifecycle) │
└─────────────────────────────────────────────────────────┘
| Feature | containerd | Docker |
|---|---|---|
| Primary purpose | Container runtime | Complete container platform |
| Image building | No (requires BuildKit or other tools) | Yes (docker build) |
| CLI tool | ctr, nerdctl | docker CLI |
| Docker Compose | Via nerdctl compose | Yes (docker compose) |
| Image registry | OCI-compliant registries | Docker Hub + OCI registries |
| Kubernetes integration | Native CRI plugin | Deprecated (requires cri-dockerd) |
| Resource footprint | Light (~50MB) | Heavier (~200MB) |
| Swarm mode | No | Yes |
| User experience | Low-level, for integrators | Developer-friendly |
- As Kubernetes runtime - containerd is the default CRI runtime for Kubernetes v1.24+.
- For embedded systems - Lightweight footprint ideal for edge and IoT.
- When you don't need Docker features - If you only need container execution, not building or Compose.
- As a platform component - If you're building your own container platform or orchestration system.
- For performance-critical applications - containerd has lower overhead than Docker.
- In CI/CD pipelines - As a lightweight runtime for running test containers.
- For development environments - Docker provides the best developer experience.
- When you need image building - Docker's build system is mature and feature-rich.
- For local testing - Docker Compose makes multi-container testing easy.
- When you need Swarm mode - Docker's built-in orchestration.
- For teams already using Docker - Familiar CLI and workflow.
- For CI/CD pipelines that need image building - Docker-in-Docker or socket mounting.
- Container startup time: containerd is 10-20% faster than Docker.
- Memory footprint: containerd uses ~50MB vs Docker's ~200MB.
- Image pull time: Comparable, both use the same OCI image format.
- CPU overhead: Both have minimal overhead when running containers.
If you're moving from Docker to containerd (for Kubernetes or other reasons), here's what you need to know:
# Install containerd
sudo apt-get install -y containerd
# Use nerdctl for Docker-like CLI
nerdctl pull nginx:alpine
nerdctl run -d -p 80:80 nginx:alpine
# Docker Compose alternative
nerdctl compose up -d
# Build images (requires buildkit)
nerdctl build -t myapp .
- "containerd will replace Docker" - False. Docker uses containerd; they complement each other.
- "Docker is obsolete" - False. Docker is still the best tool for development environments.
- "containerd is harder to use" - True for raw containerd, but nerdctl provides Docker-like experience.
- "Kubernetes dropped Docker" - Partial. Kubernetes dropped the dockershim, but you can still use Docker for image building.
containerd and Docker serve different purposes. Understand their strengths to choose the right tool for your workload.