General Flashcards
Which one is more portable: containers or VMs?
Containers. They are more lightweight and therefore, more portable
Can containers run inside VMs?
Yes
Are the majority of containers in circulation Linux or Windows based?
Linxus based. They are smaller than Windows containers
What is Docker?
Docker is a platform for building and managing containers
Since Docker is Linux based, how is it possible for it to run on Windows or Mac?
Docker runs inside a VM for Windows (WSL 2) and Mac
Give an illustration of Docker’s architecture
- Docker Client (CLI, Docker Desktop communcaties with dockerd)
- dockerd (Restful API that delegates to containerd)
- containerd (Manages the lifecycle of containers)
- runc (container runtime that executes containers)
- Host OS
- Host hardware
Describe the role of dockerd
dockerd provides an API to docker clients. It delegates most of the work to containerd
Describe the role of containerd
containerd manages images and the lifecycle of containers. it uses instances of runc to build, run, and remove containers by passing an image to it
What is the role of runc
runc is a stand-alone container runtime that interacts with the host OS to build, run, and remove containers. As soon as containers are built, runc terminates and the containerd’s shim process becomes the parent process for the running container. This is done so that Docker avoids having dozens of runc instances for running containers
Is a docker host and a docker node the same thing?
Yes
What is the role of a shim?
To become the parent process of a container after runc creates it. It also reports back to containerd when a container terminates
What is a container?
A container is an instance of an image
What is a Dockerfile?
A Dockerfile is a file containing all of the instructions necessary to build a container image. Dockerfiles are normallyu located in the root directory of an application.
docker build [Options] [path]
Is the command used to build images by specifying the path to the Dockerfile
What is an image and what is it composed of?
An image is a template for building containers. It is composed of a stack of independent layers where the base layer is usually a lightweight OS (no kernel) that provides a CLI to interact with the container
What is a registry?
A registry is a collection of repositories for images. Docker Hub is the default registry for Docker Desktop