Run, Inspect, and Remove with nerdctl · containerd
Use a familiar command style against containerd.
Learn with progress and quizzesFirst, understand the concepts.
Similar commands, different server
nerdctl provides a Docker-like CLI but connects to containerd rather than the Docker daemon. Do not assume it sees the same objects as Docker.
Feature dependencies
Bridge networking can require CNI plugins; builds can require BuildKit and other setup. This lab avoids builds and network traffic by using --net none.
Match the namespace
Matching socket and namespace lets you compare nerdctl and ctr views. Also distinguish rootless from rootful storage.
Why it matters
Familiar run, ps, and logs commands do not mean nerdctl controls a Docker daemon. Read runtime and optional-feature dependencies separately.
Work through the reasoning
Locate the objects
Specify the practice namespace and compare metadata through nerdctl and ctr. Do not assume rootless and sudo-based rootful execution share storage.
Separate feature dependencies
Networking may need CNI and builds may need BuildKit. This lab uses --net none, so success validates execution and logs rather than bridge communication or build readiness.
Learn by doing.
Use a personal Linux practice VM with containerd, runc, ctr, and sudo access. The nerdctl lab also needs nerdctl; the CRI lab needs crictl and a practice node with CRI enabled. Examples assume /run/containerd/containerd.sock; check the actual socket in other environments.
On a practice VM with nerdctl installed, run a network-disabled BusyBox container and inspect logs and exit state. If the command is missing, follow the official installation instructions first.
nerdctl --version
sudo nerdctl --namespace study-nerdctl run --net none --name study-nerd docker.io/library/busybox:1.36 echo nerdctl-ok
sudo nerdctl --namespace study-nerdctl ps -a
sudo nerdctl --namespace study-nerdctl logs study-nerd
sudo ctr --namespace study-nerdctl containers lsHow to check your result
Expect nerdctl-ok in logs and an exited study-nerd in ps -a. Compare metadata through ctr in the same namespace. For CNI errors, check --net none and tool versions.
Clean up practice resources
Run after checking the result. Confirm these resources belong to your practice run and contain no data you need to keep.
sudo nerdctl --namespace study-nerdctl rm study-nerd
sudo ctr --namespace study-nerdctl images rm --sync docker.io/library/busybox:1.36
sudo ctr namespaces remove study-nerdctlApply what you learned
--net none works but default networking fails with a CNI error. Where should you investigate first?
Reveal the reasoning after trying
Check network plugin binaries and configuration, rootful versus rootless context, and the exact error. Since execution already works, focus on network dependencies rather than reinstalling every image and runtime component.
Ready to check your understanding?
Which server does nerdctl connect to?
- The Docker daemon
- containerd
- etcd
- kube-apiserver
Reveal the reasoning after trying
containerd
nerdctl is a containerd client. Similar syntax does not mean it uses the Docker daemon.
Official documentation · Run, Inspect, and Remove with nerdctl