K8s needed Docker. Then it didn't.

k8scontainerinfrastructure

K8s needed Docker. Then it didn't. Taking Docker out of the call path ran from Kubernetes 1.5 (December 2016) to 1.24 (May 2022). Two translators appeared along the way.

The first was dockershim, which Kubernetes wrote inside kubelet so kubelet could reach Docker. After 1.20 (December 2020) announced that dockershim would be deprecated, Mirantis announced in April 2021 that the code was moving to a new repository and would be maintained as cri-dockerd. When 1.24 actually deleted dockershim from Kubernetes, clusters that still needed Docker switched to cri-dockerd.

The second was cri-containerd, which let kubelet reach containerd directly. In containerd 1.1 its code became a plugin built into containerd, the part kubelet now calls through CRI (Container Runtime Interface).


Before CRI: why Docker was hardcoded

Kubernetes was open-sourced in 2014. In 2014, "container" mostly meant Docker. The Kubernetes team later put it this way: "there weren't really a lot of other options out there and Docker was the dominant tool for working with containers." So kubelet called the Docker API directly. No abstraction. No interface. kubelet knew how to talk to Docker the same way your code calls console.log. There was no layer in between.

This worked while Docker was the only runtime Kubernetes supported. Why build an abstraction for one implementation?


rkt shows up, K8s defines CRI

In December 2014, CoreOS announced rkt (pronounced "rocket"), a competing container runtime with a different architecture. rkt 1.0 shipped in February 2016. CoreOS wanted it to run under Kubernetes.

Supporting rkt meant writing a second set of runtime calls inside kubelet, and Kubernetes 1.3 (July 2016) did exactly that. The project was nicknamed "rktnetes". Now both Docker and rkt were wired into kubelet "through an internal and volatile interface", which the Kubernetes team said "incurs significant maintenance overhead". A third runtime would have meant a third integration.

So K8s did what any engineer does when two implementations exist: define an interface. Kubernetes 1.5 (December 2016) introduced CRI, the Container Runtime Interface, as alpha. A gRPC API. kubelet speaks CRI. Any runtime that implements CRI can plug in, with no per-runtime code in kubelet.

The 1.5 announcement listed the CRI implementations in progress: cri-o, rktlet (for rkt), frakti (VM-based runtimes), and a Docker CRI shim built into kubelet. containerd got its CRI implementation in 2017.

rkt pushed Kubernetes into defining CRI, but rkt itself faded. Red Hat announced it was acquiring CoreOS in January 2018, and Red Hat was already building CRI-O. The CNCF archived rkt in August 2019.


Docker Engine never spoke CRI

Docker also had its own orchestrator: Swarm. Same job as K8s, simpler interface. docker swarm init and you had a cluster. docker service scale web=5 and you had five replicas. No CRD, no etcd.

Docker Engine never implemented CRI, and as of October 2026 it still speaks only Docker's own API. The Kubernetes team's 2022 summary: "Docker Engine's use as a container runtime predates CRI, and Docker Engine is not CRI-compatible." A search turned up no primary source explaining why Docker never added a CRI endpoint. Two things are on the record. Kubernetes shipped its own Docker shim in the same release that introduced CRI, so Docker users never waited on Docker for one. And Docker engineers did work on CRI support for containerd in 2017 (see Step 1 below).


K8s writes dockershim

K8s couldn't drop Docker. Docker was what most clusters ran on.

So in the same 1.5 release, kubelet got a built-in CRI shim for Docker: dockershim. It converted CRI calls into Docker API calls. The 1.5 announcement called it "the first step": "re-integrate Docker with kubelet using CRI." It lived inside the Kubernetes codebase. Kubernetes maintained it. Every CRI change meant updating dockershim too.

In this article a hop is one call that crosses into another process. dockershim was compiled into kubelet and ran in the same process, so kubelet calling dockershim is not a hop.

Era 0 (2014–2016): Docker calls written into kubelet (rkt calls too, from 1.3). No interface.

Era 1 (1.5, December 2016 onward): CRI exists. Docker Engine doesn't speak it. Kubernetes ships dockershim inside kubelet.

kubelet (with dockershim) → Docker Engine → containerd → runc → container

Two hops from kubelet to containerd: kubelet calls Docker Engine, and Docker Engine calls containerd.

Since Docker 1.11 (April 2016), Docker Engine had handed container execution to two separate binaries: containerd manages the container lifecycle, and runc creates the container. So after K8s called Docker, Docker still had to call containerd.

In 2018 the Kubernetes team compared the two full paths. With 105 pods on a node, containerd 1.1 with its built-in CRI plugin ran against Docker 18.03 CE with dockershim. The containerd path had lower pod startup latency, 30.89% lower kubelet CPU, 68.13% lower container runtime CPU, and 11.30% and 12.78% lower memory (RSS) for kubelet and the runtime. The post doesn't say whether "container runtime" on the Docker side means dockerd alone or dockerd plus the containerd under it, so it's unclear which processes the 68.13% compares. The Docker path has dockershim and all of Docker Engine on top of what the containerd path has, and the software versions differ too. These percentages measure the gap between the two whole paths. The post didn't measure how much CPU and memory dockershim or Docker Engine used on its own.

Kubernetes' own 2022 retrospective says the shim "was never intended to be a permanent solution" and "introduced a lot of unnecessary complexity to the kubelet itself." It stayed in kubelet from 1.5 (December 2016) to 1.24 (May 2022), about five and a half years.


Cutting Docker out, in three steps

Step 1: cri-containerd skips Docker (2017, containerd 1.0)

If Docker Engine just hands the work to containerd, kubelet could talk to containerd directly.

Through 2017, engineers from Google, Docker, IBM, ZTE, and ZJU built cri-containerd, a standalone daemon that translated CRI calls into containerd calls. Its feature-complete alpha came out on September 25, 2017, and it ran on containerd 1.0 (December 2017).

Era 2: Docker Engine bypassed. But a new daemon added.

kubelet → cri-containerd (standalone daemon) → containerd → runc → container

Still two hops to containerd; the process in the middle changed from Docker Engine to cri-containerd.

Docker Engine was out of the path now, which was progress. But cri-containerd and containerd were still two daemons talking over gRPC: one more process to deploy and babysit.

Step 2: containerd absorbs the translator (containerd 1.1, April 2018)

In containerd 1.1, the cri-containerd code was refactored into a CRI plugin, built into containerd and enabled by default. The plugin calls containerd through direct function calls instead of gRPC. The separate daemon was no longer needed.

Era 3: the CRI plugin and containerd are one process.

kubelet → containerd (built-in CRI plugin) → runc → container

One hop from kubelet to containerd.

This is the path on every containerd-based node today, and the CRI plugin on it is cri-containerd's refactored code. How containerd then creates the container through the shim and runc is in Inside containerd: How shim and runc Actually Work.

Step 3: K8s deletes dockershim (K8s 1.24, May 2022)

Kubernetes 1.20 (December 2020) deprecated dockershim, and 1.24 (May 2022) removed it. kubelet could no longer talk to Docker Engine on its own. Clusters still on Docker had to either switch to containerd or CRI-O, or install cri-dockerd to keep Docker as the runtime. On Nodes that dropped Docker, containers ran fine, but scripts, settings and tools on the Node that called Docker directly had to change. The Kubernetes migration page "Check whether dockershim removal affects you" lists these:

  • Docker commands such as docker ps or systemctl restart docker.service, run from privileged Pods, Node startup scripts, or monitoring and security agents installed directly on the Node
  • Private registry and image mirror settings in /etc/docker/daemon.json, which have to move to the new runtime's config
  • docker ps and docker exec used to troubleshoot over SSH, which no longer list any containers
  • kubelet's /metrics/cadvisor, whose container name format changes with the runtime and which loses a set of filesystem metrics
  • CI that mounts the Node's docker.sock into a Pod to build images with the Node's Docker

Example: CI mounting docker.sock

On a Node that used Docker Engine as its runtime, Docker Engine exposed /var/run/docker.sock. Some CI setups ran build jobs as Pods inside the cluster and mounted that socket to build images with the Node's Docker. The Kubernetes blog's name for this pattern is "Docker in Docker".

A Docker-runtime Node had two daemons:

  • Docker Engine → /var/run/docker.sock ← CI Pods mounted this
  • containerd → /run/containerd/containerd.sock ← Docker used this internally

After the Node switched to containerd as its runtime (and dropped Docker from the image), it had one:

  • containerd → /run/containerd/containerd.sock ← kubelet talks directly to this
  • Docker Engine → gone
  • docker.sock → gone

containerd has its own socket. But docker build doesn't speak containerd's API. It only talks to Docker's socket. Different program, different protocol.

docker build → looks for /var/run/docker.sock → file doesn't exist → fails

Two ways out:

  1. Keep Docker Engine on the Node and connect kubelet to it through cri-dockerd → docker.sock stays → pipeline unchanged
  2. Switch to buildah → builds the image from a Dockerfile inside a container → no Docker daemon, no socket

The Kubernetes dockershim FAQ lists four tools that build images without Docker: img, buildah, kaniko, and buildkit-cli-for-kubectl. As of October 2026, the kaniko repository was archived in June 2025, the buildkit-cli-for-kubectl repository is archived too, and img was last updated in May 2024. Of the four, only buildah is still being updated.

cri-dockerd kept pipelines working for teams that couldn't rewrite them overnight, and it still ships new releases (v0.4.9 in October 2026). But its call chain is longer:

kubelet → cri-dockerd → Docker Engine → containerd → runc

Three hops from kubelet to containerd; using containerd directly takes one.

Another path at the same time: CRI-O

While Docker was being taken out of the path, Red Hat built CRI-O from scratch. CRI-O 1.0 came out in October 2017. Purpose-built for K8s. No Docker legacy. No image build. No extras. Speaks CRI on top, and on the bottom calls runtimes that follow the OCI (Open Container Initiative) spec, such as runc. Does what K8s needs and nothing more.

kubelet → CRI-O → crun or runc → container

CRI-O's current config defaults to crun; runc can be configured instead.

OpenShift 4 has run on CRI-O in production since June 2019. containerd can do more things. CRI-O's pitch is that it shouldn't have to.


The timeline

YearEvent
2014Kubernetes open-sourced. Docker calls written into kubelet. No interface. CoreOS announces rkt (December)
2015Docker donates runc to the new Open Container Initiative (June). Kubernetes 1.0 (July)
2016Docker 1.11 runs containers through containerd and runc (April). K8s 1.3 adds rkt inside kubelet (July). K8s 1.5 introduces CRI as alpha, with dockershim built in (December)
2017Docker donates containerd to CNCF (March). cri-containerd alpha (September). CRI-O 1.0 (October). containerd 1.0 (December)
2018Red Hat announces it is acquiring CoreOS (January). containerd 1.1 with the CRI plugin built in (April). Docker for Mac ships Kubernetes in its stable channel (July)
2019containerd graduates from CNCF (February). OpenShift 4 runs on CRI-O (June). CNCF archives rkt (August). Docker sells its enterprise business to Mirantis (November)
2020K8s 1.20 deprecates dockershim (December). The announcement caused enough panic that Kubernetes published "Don't Panic: Kubernetes and Docker"
2021Mirantis announces cri-dockerd (April)
2022K8s 1.24 removes dockershim (May). On Nodes that drop Docker Engine, scripts, settings and CI jobs that used Docker directly have to change

Eight years from kubelet calling Docker directly in 2014 to kubelet holding no Docker code at all in 2022.


Where Docker ended up

In November 2019 Docker sold its enterprise business to Mirantis. On November 13, Docker announced "the next chapter in the Docker story, one that's focused on developers." The focus moved to the other end of the pipeline: building images, not running them.

What Docker keptWhat Docker lost
Docker Desktop (developer local environment)Runtime on K8s clusters
Docker Hub (image registry)Docker Enterprise (sold to Mirantis in 2019; Swarm mode itself still ships in Docker Engine)
docker build (image construction)Docker Engine as the runtime most K8s clusters used
Docker Compose (local multi-container dev)dockershim (K8s deleted it, Mirantis picked up the pieces)

The current state of the industry:

Developer laptop:
  docker build → build image
  docker push → push to registry

Production K8s cluster:
  kubelet → containerd → runc → container
  (No Docker anywhere in this path.)

Docker donated its core

Docker donated runc to the OCI in 2015 and containerd to CNCF in 2017. That sounds like giving away the crown jewels. At containerd's CNCF graduation in 2019, Michael Crosby, a containerd maintainer and Docker engineer, described the goal as "to share a robust and extensible runtime."

Today Kubernetes nodes run containerd directly, Docker Engine runs on containerd too, and CNCF hosts containerd.


References