Podman, Docker and containerd Compared: Container Engines and Runtimes
#podman#docker#containerd#container-runtime#rootless
Contents
Assume you start the same nginx container in three ways.
docker run -d --name web nginx
nerdctl run -d --name web nginx # CLI for containerd
podman run -d --name web nginx # run as a regular user
nginx runs in all three cases, but the process trees differ.
# docker run
systemd
├─ dockerd
├─ containerd
└─ containerd-shim-runc-v2
└─ nginx
# nerdctl run
systemd
├─ containerd
└─ containerd-shim-runc-v2
└─ nginx
# podman run
systemd
└─ conmon
└─ nginx
The nginx started by Docker and by nerdctl both sit under containerd-shim-runc-v2.
The nginx started by Podman sits under conmon, with neither dockerd nor containerd anywhere.
Each tool covers a different part of running a container.
containerd-shim-runc-v2 is an intermediate process (a shim) that containerd starts for each container. It calls runc (the OCI runtime that actually creates the container using kernel features), then stays on as the container's parent process, handling its standard I/O and exit code. runc-v2 means it implements containerd's shim v2 interface with runc.
1. Docker, containerd and Podman
1.1 Docker: A Container Platform
Docker is a platform that bundles what you need to build, run and ship containers.
It provides the docker CLI, the dockerd daemon, image builds (BuildKit), and network and volume management.
Actually running containers is delegated internally to containerd.
1.2 containerd: A Container Runtime Daemon
containerd is a daemon that manages the container lifecycle: pulling and storing images, and creating, running and stopping containers.
It was split out of Docker and is a CNCF graduated project.
It is used less directly by people and more as a component called by higher-level systems such as Docker and Kubernetes.
1.3 Podman: A Daemonless Container Engine
Podman (Pod Manager) is a container engine that runs without a daemon.
The podman command calls the OCI runtime directly to run containers and does not use containerd.
Its CLI is nearly the same as Docker’s, so in many cases you can type podman where you would type docker.
| Name | Kind | What it covers | Where it is mostly used |
|---|---|---|---|
| Docker | container platform | CLI, daemon, builds, networks, volumes | developer machines, single servers |
| containerd | container runtime daemon | image management, container lifecycle | Kubernetes nodes, inside Docker |
| Podman | daemonless container engine | CLI, running containers, pods, builds (Buildah) | RHEL-family servers, rootless use |
2. How Containers Run: Engines, Runtimes and OCI
Running a container is split into several layers.
- OCI runtime: configures the kernel’s namespaces and cgroups to start a single process as a container. runc and crun are the best known. It exits once the container is started.
- Container runtime (high-level): pulls images, prepares the filesystem, calls the OCI runtime, and manages running containers. containerd and CRI-O belong here.
- Engine and CLI: take user commands, tell the runtime what to do, and add features such as builds and networking. Docker and Podman belong here.
OCI (Open Container Initiative) is the standard that defines the image format (image spec) and runtime behavior (runtime spec).
All three tools use OCI images and start containers with an OCI runtime, so an image built with Docker runs on Podman or containerd.
3. Docker’s Execution Path
When you run docker run, the command travels down in this order.
- docker CLI: calls dockerd’s REST API over
/var/run/docker.sock. - dockerd: prepares the image, network and volumes, and asks containerd to create the container.
- containerd: starts a shim process (
containerd-shim-runc-v2) for each container. - shim: calls runc to create the container.
- runc: sets up namespaces and cgroups, starts nginx and exits. The shim remains as nginx’s parent process.
dockerd creates its containers in containerd’s moby namespace.
That is why containerd’s debugging tool can see containers created by Docker.
sudo ctr -n moby containers list
Since Docker Engine 29, fresh installs also store images in containerd’s image store.
Installations upgraded from earlier versions keep the previous storage (the overlay2 graph driver).
4. containerd’s Execution Path
Using containerd directly removes the dockerd step.
nerdctl or the Kubernetes kubelet sends requests straight to containerd, and everything below is the same as with Docker.
There are two CLIs for containerd.
| CLI | Purpose |
|---|---|
ctr | debugging tool bundled with containerd |
nerdctl | CLI with Docker-style usage; a separate project |
4.1 Shims and Snapshotters
- shim: one process per container. It holds the container’s standard I/O and exit code, so containers keep running even when containerd restarts.
- snapshotter: stacks image layers into the container’s root filesystem. On Linux it uses overlayfs by default.
overlayfs is a Linux filesystem that stacks several directories so they look like one. Image layers sit underneath as read-only, and anything the container changes is written only to the writable layer on top. So no matter how many containers start from the same image, its layers are stored on disk only once.
4.2 CRI: The Link to Kubernetes
CRI (Container Runtime Interface) is the gRPC interface kubelet uses to call a container runtime.
containerd has a built-in CRI plugin, so kubelet calls containerd directly without Docker.
CRI-O is another runtime that implements CRI.
5. Podman’s Execution Path
When you run podman run, the command travels down in this order.
- podman: pulls the image and prepares the filesystem. Image and container data are stored on disk (containers/storage), not in a daemon.
- conmon: a monitor process, one per container. It calls the OCI runtime and holds the container’s I/O and exit code.
- crun or runc: starts the container and exits. Podman’s default OCI runtime is crun.
- podman exits: once the container is up, the
podmancommand ends, leaving only conmon and nginx.
5.1 No Daemon, and conmon
Docker’s shim and Podman’s conmon do the same job.
Both run one per container and handle the container’s I/O and exit code.
Docker has dockerd receiving every request, while Podman has no daemon.
- Docker: every request goes through a single root dockerd. If dockerd stops, no new containers can be created.
- Podman: each command starts a
podmanprocess that exits when done. Each user has their own storage and containers.
Since there is no daemon, starting containers at boot or restarting them is left to systemd.
For tools that need the Docker API, podman system service can open a Docker-compatible API socket.
5.2 Rootless: User Namespaces and UID Mapping
Rootless means running containers with regular user rights, without root.
Podman uses a user namespace to map UIDs inside the container to different UIDs on the host.
# /etc/subuid
alice:100000:65536
| UID inside the container | UID on the host |
|---|---|
| 0 (root) | 1000 (alice) |
| 1 ~ 65536 | 100000 ~ 165535 |
Root inside the container has only alice’s rights on the host.
Even if an attacker escapes the container, they cannot do anything on the host beyond what alice can.
Rootless has limits.
- Ports: ports below 1024 cannot be bound with the default settings.
- Networking: a regular user cannot create host network devices, so a user-space networking tool is used. Since Podman 5.0 the default is pasta; before that it was slirp4netns.
- Storage: images are stored separately in the user’s home (
~/.local/share/containers/storage). Each user pulls the same image separately.
5.3 Pods
Like a Kubernetes Pod, Podman can group several containers together.
Containers in the same pod share a network namespace and talk to each other over localhost.
podman pod create --name web -p 8080:80
podman run -d --pod web nginx
podman run -d --pod web my-exporter
You can export a pod definition as Kubernetes YAML (podman kube generate) or run a pod from Kubernetes YAML (podman kube play).
6. Permission Models Compared: Root Daemon, docker Group, Rootless
The Docker daemon runs as root by default.
That is why the Docker documentation warns about the docker group:
The
dockergroup grants root-level privileges to the user.
A user in the docker group can mount the host’s / into a container and modify any host file.
Adding a user to the docker group is the same as giving that user root.
| Docker (default) | Docker rootless mode | Podman rootless | |
|---|---|---|---|
| Daemon | dockerd running as root | dockerd running as the user | none |
| Container processes | owned by root | owned by the user | owned by the user |
| Who can use it | docker group = root | that user only | that user only |
| Setup | default | separate install and setup | default |
Docker also supports rootless mode, but it has to be set up separately.
Podman runs rootless from the start when run as a regular user.
7. Image Builds: BuildKit and Buildah
| Tool | How it builds |
|---|---|
| Docker | docker build. BuildKit is the default builder since Docker Engine 23.0 |
| containerd | no build feature. nerdctl build uses a separately running BuildKit (buildkitd) |
| Podman | podman build, which uses Buildah internally |
All three build from a Dockerfile (Podman also calls it a Containerfile), and the result is an OCI image.
An image built with any of them can be pushed to a registry and run with the others.
8. Use in Kubernetes
Kubernetes removed its Docker integration layer (dockershim) in 1.24, and kubelet now calls containerd or CRI-O directly through CRI.
Images built with Docker follow the OCI standard, so they run unchanged.
Podman does not implement CRI, so it is not used as a node runtime; it is used to try Kubernetes YAML locally (podman kube play).
9. Comparison and How to Choose
| Docker | containerd | Podman | |
|---|---|---|---|
| Kind | container platform | container runtime daemon | daemonless container engine |
| Daemon | dockerd + containerd | containerd | none |
| Container monitor process | containerd-shim | containerd-shim | conmon |
| Default OCI runtime | runc | runc | crun |
| Default rights | root daemon | root daemon | the user who ran it |
| Image builds | BuildKit | none (nerdctl + BuildKit) | Buildah |
| CLI | docker | ctr, nerdctl | podman |
| Kubernetes node runtime | no built-in support since 1.24 | built-in CRI | not applicable |
- When Docker fits: handling everything from build to run with one tool on a developer machine, or using Docker Compose and other Docker ecosystem tools as they are.
- When containerd fits: when a higher-level system such as a Kubernetes node manages containers and you want a lightweight runtime.
- When Podman fits: running containers per user without a root daemon, running containers as systemd services, or using RHEL-family servers.