Nerdctl: AI-Optimized Technical Reference
Overview
Container CLI that communicates directly with containerd runtime, bypassing Docker daemon layer. Drop-in replacement for Docker commands with Kubernetes integration capabilities.
Architecture & Core Problem
- Docker path: CLI → dockerd → containerd → container
- Nerdctl path: CLI → containerd → container
- Elimination: Removes Docker daemon overhead layer
- Kubernetes reality: K8s clusters already use containerd as runtime
Configuration Requirements
Critical Dependencies
- containerd daemon (must be running)
- CNI networking plugins (required for networking)
- BuildKit daemon (required for image builds)
- systemd services (proper configuration needed)
Installation Reality
- Recommended: nerdctl-full tarball (includes dependencies)
- Avoid: minimal version (missing critical components)
- Platform limitation: macOS requires Lima VM wrapper
Network Configuration (Critical Failure Point)
Default failure: CNI bridge networking not configured
Error symptoms:
- Commands hang for 5+ minutes
- "CNI plugin bridge not found"
- "context deadline exceeded"
Required setup:
# CNI plugins location: /opt/cni/bin/
# CNI config location: /etc/cni/net.d/
# Minimum config: 10-bridge.conflist with bridge type
OS-specific issues:
- RHEL/CentOS 8: firewall blocks CNI by default
- Ubuntu 20.04: SELinux conflicts in rootless mode
- Ubuntu 22.04: works without modifications
BuildKit Integration (High Failure Rate)
Critical Requirements
- Separate daemon: buildkitd must run independently
- Socket path: /run/buildkit/buildkitd.sock (version-dependent)
- Version compatibility: BuildKit 0.11+ changed default paths
Common Failures
- Silent failures: BuildKit runs out of /tmp space
- Cryptic errors: "rpc error: code = Unknown desc = failed to receive status"
- Version mismatches: containerd/BuildKit upgrades break compatibility
- Service startup: systemd service may not auto-start
Resolution
sudo systemctl enable --now buildkit
# Verify: systemctl status buildkit
Command Compatibility Matrix
Direct Replacements (100% Compatible)
docker run
→nerdctl run
docker ps
→nerdctl ps
docker build
→nerdctl build
docker-compose up
→nerdctl compose up
Syntax Differences (Breaking Changes)
- Volume mounting: path handling varies
- Port publishing: syntax differences exist
- Network creation: command variations
- docker-compose: edge cases in complex configurations
Resource Requirements
Time Investment
- Initial setup: 3+ hours (first-time users)
- Network configuration: 2-4 hours (if unfamiliar with CNI)
- BuildKit troubleshooting: 2-6 hours (common failure scenario)
- Migration testing: 1-3 days (for production workloads)
Expertise Prerequisites
- containerd knowledge: documentation assumes existing expertise
- CNI networking: required for network troubleshooting
- systemd services: needed for daemon management
- Kubernetes concepts: beneficial for advanced features
Performance Characteristics
Measurable Improvements
- K8s environments: eliminates Docker daemon overhead
- Large images (10GB+): lazy pulling with Stargz snapshotter
- Container startup: marginal improvement over Docker
Performance Reality
- Simple containers: negligible difference vs Docker
- Complex workloads: depends on containerd optimization
- Network operations: can be slower due to CNI complexity
Critical Warnings & Failure Modes
Production Blockers
- Third-party tools: many expect Docker socket specifically
- GUI dependencies: no Docker Desktop equivalent
- Error messaging: less informative than Docker
- Community size: smaller support ecosystem
Breaking Points
- 1000+ containers: UI performance degrades significantly
- Rootless networking: distribution-specific failures
- CNI plugin conflicts: multiple network managers cause issues
- BuildKit memory: requires adequate /tmp space allocation
Migration Risks
- CI/CD pipelines: volume mount differences break builds
- Development workflows: local setup complexity increases
- Team knowledge: learning curve for containerd concepts
Kubernetes Integration Advantages
Unique Capabilities
# Direct pod access (bypasses kubectl)
nerdctl --namespace k8s.io ps
nerdctl --namespace k8s.io exec -it pod-name bash
# Build images without registry
nerdctl --namespace k8s.io build -t debug-app .
Operational Benefits
- Debugging efficiency: direct container access
- Registry bypass: local image builds for K8s
- Native integration: uses existing containerd runtime
Security Features
Rootless Mode
- Setup complexity: more involved than Docker rootless
- Distribution support: Ubuntu 20.04 has known issues
- Kernel requirements: specific modules needed
Image Encryption
- Built-in support: ocicrypt integration
- Compliance value: useful for regulated environments
- Implementation: simpler than Docker third-party solutions
Decision Criteria
Migrate When
- Running Kubernetes in production (containerd already present)
- Need image encryption/advanced security
- Want to avoid Docker licensing costs
- Require lazy pulling for large images
- Need direct K8s pod debugging
Stay with Docker When
- Docker works without issues
- Team lacks containerd expertise
- Development primarily on macOS
- Third-party tools require Docker socket
- Setup/maintenance overhead concerns outweigh benefits
Resource Cost Analysis
- Migration effort: 1-4 weeks depending on complexity
- Training overhead: 2-8 hours per team member
- Operational complexity: increased troubleshooting difficulty
- Support costs: smaller community, fewer resources
Troubleshooting Decision Tree
Container Startup Failures
- Check containerd:
journalctl -u containerd
- Verify CNI:
ls /etc/cni/net.d/
- Test basic networking: bridge configuration
- Validate BuildKit:
systemctl status buildkit
Build Failures
- Confirm BuildKit daemon status
- Check /tmp space availability
- Verify socket path compatibility
- Review BuildKit logs for specific errors
Network Issues
- Validate CNI plugin installation
- Check firewall rules (RHEL/CentOS)
- Test bridge network creation
- Verify network namespace configuration
Useful Links for Further Investigation
Actually Useful Nerdctl Resources
Link | Description |
---|---|
Nerdctl GitHub Repository | Main repo with releases, issues, and docs |
Installation Releases | Download the nerdctl-full tarball, not the minimal version (which is missing half the shit you need) |
Troubleshooting FAQ | Actual solutions when things inevitably break |
Lima Project | Best way to run nerdctl on macOS (gives you Linux VMs with everything configured) |
CNI Networking Guide | You'll need this when networking breaks |
Rootless Mode Setup | For running without root (setup is annoying but worth it) |
Stargz Lazy Loading | Makes huge ML images start faster |
Image Encryption | Actually useful for regulated environments |
Docker Compose Support | Your docker-compose files should just work |
GitHub Discussions | Ask questions here, community is helpful |
Containerd Documentation | When nerdctl problems are actually containerd problems |
Container Runtime Comparison | Official K8s docs on runtime choices |
Docker Licensing Info | Why some companies are looking for alternatives |
Related Tools & Recommendations
GitOps Integration Hell: Docker + Kubernetes + ArgoCD + Prometheus
How to Wire Together the Modern DevOps Stack Without Losing Your Sanity
containerd - The Container Runtime That Actually Just Works
The boring container runtime that Kubernetes uses instead of Docker (and you probably don't need to care about it)
Rancher Desktop - Docker Desktop's Free Replacement That Actually Works
Discover why Rancher Desktop is a powerful, free alternative to Docker Desktop. Learn its features, installation process, and solutions for common issues on mac
Stop Docker from Killing Your Containers at Random (Exit Code 137 Is Not Your Friend)
Three weeks into a project and Docker Desktop suddenly decides your container needs 16GB of RAM to run a basic Node.js app
CVE-2025-9074 Docker Desktop Emergency Patch - Critical Container Escape Fixed
Critical vulnerability allowing container breakouts patched in Docker Desktop 4.44.3
CNI Debugging - When Shit Hits the Fan at 3AM
You're paged because pods can't talk. Here's your survival guide for CNI emergencies.
Container Network Interface (CNI) - How Kubernetes Does Networking
Pick the wrong CNI plugin and your pods can't talk to each other. Here's what you need to know.
I Ditched Docker Desktop for Rancher Desktop - Here's What Actually Happened
3 Months Later: The Good, Bad, and Bullshit
Lima - Linux VMs That Don't Suck
Boot Linux on your Mac without losing your sanity or your RAM
Podman Desktop Alternatives That Don't Suck
Container tools that actually work (tested by someone who's debugged containers at 3am)
Deploy Django with Docker Compose - Complete Production Guide
End the deployment nightmare: From broken containers to bulletproof production deployments that actually work
Docker Compose 2.39.2 and Buildx 0.27.0 Released with Major Updates
Latest versions bring improved multi-platform builds and security fixes for containerized applications
Docker Business vs Podman Enterprise Pricing - What Changed in 2025
Red Hat gave away enterprise infrastructure while Docker raised prices again
Podman Desktop - Free Docker Desktop Alternative
competes with Podman Desktop
SpaceX Buys $17B Worth of Spectrum to Connect Your Phone to Satellites
EchoStar finally sells spectrum they've been sitting on for years
Your Calculator App Ships With a Whole Browser (And That's Fucked)
Alternatives that won't get you fired by security
Electron - Chrome Wrapped Around Your Web App
Desktop Apps Without Learning C++ or Swift
Fix Kubernetes ImagePullBackOff Error - The Complete Battle-Tested Guide
From "Pod stuck in ImagePullBackOff" to "Problem solved in 90 seconds"
Fix Kubernetes OOMKilled Pods - Production Memory Crisis Management
When your pods die with exit code 137 at 3AM and production is burning - here's the field guide that actually works
Colima - Docker Desktop Alternative That Doesn't Suck
For when Docker Desktop starts costing money and eating half your Mac's RAM
Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization