Regarding containerd and docker

what’s the difference between containerd and docker how does it vary? If docker architecture posses containerd already why we need a docker shim to work on kubernetes ? why can’t we use CRI instead?

containerd is the “backend” of Docker; the Docker people factored out the low level stuff from docker – its container runtime – and that became containerd. They donated the project to CNCF, but I believe they use it as well.

It used to be true that Kubernetes was built on top of docker, and there was code called “dockershim” that helped to that. dockershim is gone as of v1.24 of Kubernetes. Instead, we use the Container Runtime Interface (CRI), which containerd conforms to; using containerd, Kubernetes gets docker like services, but without Docker.

We have a more detailed explanation here