Why containerd
containerd is the container runtime that Docker and Kubernetes use under the hood. It manages the complete container lifecycle — image pull, create, start, snapshot, network, stop.
Install
# Already included in Docker Desktop and most K8s distributions
# Standalone install:
curl -LO https://github.com/containerd/containerd/releases/latest/download/containerd-static-linux-amd64.tar.gz
tar -xf containerd-static-linux-amd64.tar.gz -C /usr/local
# CLI
brew install nerdctl
nerdctl (Docker-Compatible CLI)
# Pull image
nerdctl pull nginx:latest
# Run container
nerdctl run -d -p 8080:80 --name web nginx
# List containers
nerdctl ps
# Build image
nerdctl build -t myapp:latest .
# Compose
nerdctl compose up -d
ctr (Low-Level CLI)
# Pull image
ctr images pull docker.io/library/nginx:latest
# List images
ctr images list
# Run container
ctr run -d docker.io/library/nginx:latest web
# Namespaces
ctr namespaces list
containerd API (Go)
import "github.com/containerd/containerd"
client, _ := containerd.New("/run/containerd/containerd.sock")
image, _ := client.Pull(ctx, "docker.io/library/nginx:latest")
container, _ := client.NewContainer(ctx, "web",
containerd.WithNewSnapshot("web-snapshot", image),
containerd.WithNewSpec(oci.WithImageConfig(image)),
)
task, _ := container.NewTask(ctx, cio.NewCreator())
task.Start(ctx)
Key Features
- Industry standard — Docker, K8s, cloud providers
- OCI compliant — standard container images and runtimes
- Snapshots — efficient filesystem management
- Namespaces — multi-tenant isolation
- CRI plugin — native Kubernetes integration
- CNCF Graduated — production foundation
Resources
Need to extract container runtime data, image metadata, or registry info? Check out my Apify tools or email spinov001@gmail.com for custom solutions.
Top comments (0)