Containers

Describe in detail what happens when you run a container

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

  1. The Docker client converts the run command into an API payload
  2. It then POST the payload to the API endpoint exposed by the Docker daemon
  3. When the daemon receives the command to create a new container, it makes a call to containerd via gRPC
  4. containerd converts the required image into an OCI bundle and tells runc to use that bundle for creating the container
  5. runc interfaces with the OS kernel to pull together the different constructs (namespace, cgroups, etc.) used for creating the container
  6. Container process is started as a child-process of runc
  7. Once it starts, runc exists