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.

containerd Docker Runtime Platform
The Core Difference: Runtime vs Platform

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.

Docker Platform
CLI | REST API | Compose | Build | Swarm
↓ uses ↓
containerd (container runtime)
Since Docker 1.11, Docker Engine has used containerd as its underlying container runtime. Docker doesn't compete with containerd—it builds on it.
How Docker Uses containerd

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) │ └─────────────────────────────────────────────────────────┘
containerd vs Docker: Detailed Comparison
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
When to Use containerd
  • 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.
When to Use Docker
  • 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.
Performance Comparison
  • 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.
Migration: Docker to containerd

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 .
Docker and containerd can run side-by-side. They use different storage locations, so no conflict. You can gradually migrate workloads.
Common Misconceptions
  • "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.
Frequently Asked Questions
Does Docker still use containerd?
Yes! Docker has used containerd as its underlying runtime since Docker 1.11. When you run a container with Docker, it uses containerd to manage the container lifecycle.
Can I use Docker and containerd together?
Yes, they can run side-by-side. They use different storage locations (`/var/lib/docker` vs `/var/lib/containerd`). Many Kubernetes nodes have both installed.
Which is better for Kubernetes?
containerd is the default and recommended runtime for Kubernetes v1.24+. Docker requires cri-dockerd, which adds extra complexity and overhead.
Can I build images with containerd?
containerd doesn't have a built-in image builder. You can use BuildKit, kaniko, or nerdctl (which uses BuildKit) to build images with containerd.
Is Docker being deprecated?
No. Docker is still actively developed and remains the best tool for development. Only the dockershim (Docker's integration with Kubernetes) was deprecated.
Which has better Windows support?
Both support Windows containers. Docker Desktop provides a better Windows development experience. containerd supports Windows containers on Windows Server.
Should I switch from Docker to containerd?
For development: No, stick with Docker. For Kubernetes runtime: Yes, use containerd. For standalone containers: It depends on your needs.
Does nerdctl replace docker CLI?
nerdctl provides a Docker-compatible CLI for containerd. Many commands are identical, but not all Docker features are implemented. It's a good alternative for containerd users.
Previous: What is containerd? Next: Installing containerd

containerd and Docker serve different purposes. Understand their strengths to choose the right tool for your workload.