# The dockershim went away and my images did not notice

> Kubernetes 1.24 removed dockershim from the kubelet, and a lot of people read that as "Docker images stop working", which they do not. What changed, and why I read the whole thing without running a cluster.

- Author: Deyan Peev (https://deyanpeev.com)
- Published: 2022-05-21
- Tags: Kubernetes, Docker, Containers, containerd
- URL: https://deyanpeev.com/posts/the-dockershim-went-away

Kubernetes 1.24 landed on the third of May, and the line everybody quoted was
that dockershim had been removed from the kubelet. The version of that sentence
that reached most people, including a couple of the developers I work with, was
"Kubernetes is dropping Docker".

I don't run Kubernetes. I run containers on ECS and on machines, and Kubernetes
is on my list of things I read about ahead of time, so that when it does turn up
I am not learning it under pressure. This release was worth an afternoon because
the confusion around it says a lot about what a container is.

# Four things wearing the same name

"Docker" means at least four separate things, and the removal touches only one
of them.

There is the **image format**, the layered filesystem and manifest you build
with a Dockerfile. There is the **registry protocol** that ships those images
around. There's the **Docker Engine**, the daemon that runs containers on a
machine. And then the **`docker` CLI**, which is what most people mean when
they say the word.

The image format and the registry protocol are standardised. They are OCI
specifications, and every runtime in this ecosystem reads them. That's why the
Kubernetes announcement can say, flatly, that images which ran before will run
unchanged afterwards. Nothing about what you build changed.

# The shim in the kubelet

Kubelet talks to a container runtime through the Container Runtime Interface. The
Docker Engine doesn't speak CRI (it predates it), so the Kubernetes project
maintained a shim called dockershim that translated between the two.

So the kubelet codebase carried two paths, one for every CRI runtime and one
special case for Docker. Deprecated in 1.20, removed in 1.24. The clusters
affected are the ones whose nodes were configured to use Docker Engine as the
runtime. They need containerd, or CRI-O, or `cri-dockerd` if they really want to
keep Docker Engine underneath.

It is a node-level configuration concern for cluster operators, and anybody
writing a Dockerfile won't see it.

The detail I enjoyed is that containerd was inside Docker all along. Docker
Engine uses containerd to run containers. The removal takes out the layer above
it and lets the kubelet talk to containerd directly, so there are fewer moving
parts doing the same job.

# docker ps on the node

One thing does go away on nodes that switch. `docker ps` on the node no longer
shows you the containers Kubernetes is running, because Kubernetes isn't using
Docker Engine to run them. The equivalents are `crictl`, or the cluster's own
tooling.

That matters more than it sounds like. Every debugging habit built on "SSH to the
node and run `docker logs`" stops working, and I'd guess the muscle memory is
the expensive part of the migration, more than the configuration.

# Why I read a release for software I do not run

Partly because this is the clearest example I have seen of an interface doing
its job. The OCI image spec meant a runtime could be swapped underneath an entire
ecosystem and the artefacts kept working. If images had been a Docker
implementation detail and not a specification, this release would have been a
migration for everybody. As it is, it's a configuration change for cluster
operators.

The misreading is instructive as well. "Kubernetes drops Docker" was wrong but
hard to avoid, because the word covers four things and the sentence only meant
one of them.

The reason I would defend, though, is that I'd rather learn how a system fits
together while nothing is on fire. I have spent enough time on the other version
of that (reading documentation at speed because something is down) to think
that an afternoon on a release note for a tool I might use later is cheap.
