As a key component of Kubernetes, the container runtime manages the lifecycle of images and containers. This document compares the usage scenarios, call chains, and common commands of Docker and containerd to help you choose the most suitable container runtime for your needs.
As a popular container runtime, containerd has a shorter call chain, fewer components, higher stability, and lower resource consumption compared to Docker. CCE supports both containerd and Docker. In general, containerd is recommended. However, you should choose Docker as your container runtime in the following scenarios:
When docker-in-docker functionality is required.
When commands like docker build/push need to be executed on CCE nodes.
When you need to interact with the Docker API.
When Docker Compose or Docker Swarm is necessary.
Comparison of two runtime call chains
Runtime
Call chain
docker
kubelet > dockershim > dockerd > containerd
containerd
kubelet > CRI plugin > containerd
Comparison of common commands of two cloud container engines: docker and containerd