Aymen El Amri - eralabs.io
Tunisia Docker Meetup - Sousse - March 2019
e.g: Linux-VServer, OpenVZ, KVM
sudo apt install cgroup-tools
sudo apt install stress
Start by installing CGroup Tools and stress utility as we are going to make some stress tests.
In 2015, Docker announced runC: a lightweight, portable container runtime.
runC is basically a little command-line tool to leverage libcontainer directly, without going through the Docker Engine.
The goal of runC is to make standard containers available everywhere.
This project was donated to the Open Container Initiative (OCI).
The libcontainer repository has been archived now.
Since containers become mainstream, the different actors in the containers ecosystem have been working on standardization.
Standardization is a key to automation and generalization of best practices.
While giving the runC project to the OCI, Docker started using containerd in 2016, as a container runtime that interface with the underlying low-level runtime runC.
Prior to version 1.11, Docker engine was used to manage volumes, networks, containers, images etc..
Now, Docker architecture is broken into four components:
The binaries are respectively called docker, docker-containerd, docker-containerd-shim, and docker-runc.
1) Docker engine creates the container and passes it to containerd.
2) Containerd calls containerd-shim
3) Containerd-shim uses runC to run the container
4) Containerd-shim allows the runtime (runC in this case) to exit after it starts the container
1) runC can exit after starting the container and we don’t have to have the whole runtime processes running.
2) containerd-shim keeps the file descriptors like stdin, stdout and stderr open even when Docker and/or containerd die.
Low-Level Runtime | High-Level Runtime |
---|---|
light, fast and non-conflictual with other higher levels of containers management | Manage the lifecycle of containers |
Only allows running containers. | Responsible for image transfer and storage, container execution, supervision, storage, network attachments, etc.. |
source: www.ianlewis.org
sudo dockerd --add-runtime=<runtime-name>=<runtime-path>
sudo apt-get install nvidia-container-runtime
sudo dockerd --add-runtime=nvidia=/usr/bin/nvidia-container-runtime
Example:
We can add new runtime using Docker by executing:
Kubernetes is one of the most popular orchestration systems.
With the evolving number of containers runtime, kubernetes aims to be more extensible and interface with more containers runtimes other than Docker
CoreOS wanted to use kubernetes with RKT runtime and offered patches to kubernetes to use this runtime as an alternative to Docker.
Instead of changing kubernetes code base when adding a new container runtime, Kubernetes upstream decided to create CRI or Container Runtime Interface
CRI or Container Runtime Interface is a set of APIs and libraries that allows running different containers runtime in Kubernetes.
Any interaction between Kubernetes core and a supported runtime is performed through the CRI API.
The first container runtime created for the kubernetes CRI interface.
cri-o is not intended to replace Docker but it can be used instead of Docker runtime in the specific context of Kubernetes.
With cri-containerd, users can run Kubernetes clusters using containerd as the underlying runtime without Docker installed.
gVisor is a project developed by Google which implements around 200 of the Linux system calls in userspace, for additional security compared to Docker containers that run directly on top of the Linux kernel and are isolated with namespaces.
Kata Containers is an open source project building lightweight virtual machines that plug into the containers ecosystem.
CRI-O Kata Containers allows running Kata Containers on Kubernetes instead of Docker default runtime.
The project of building a single monolithic Docker platform is somehow abandoned and gave birth to Moby project where Docker is composed of many components like RunC.
As we have seen, Docker donated RunC to the Open Container Initiative (OCI), but what is this initiative?
The OCI is a lightweight, open governance structure, launched in 2015 by Docker, CoreOS and other leaders in the container industry.
The Open Container Initiative (OCI) aims to establish common standards for software containers in order to avoid potential fragmentation and divisions inside the container ecosystem.