Slide 1

Slide 1 text

Docker!!!! It’s built on Cgroups

Slide 2

Slide 2 text

I’m Bakare Emmanuel • Remote DevOps Engineer @Deimos • Volunteer Bootcamp Facilitator and LCA @Andela • DevOps and Linux Fan Boy • General Weird Guy with some humour • Incapable of understanding when to use upper case and Lower Case • People call me Bakman, so there’s also that! @ T i e m m a B a k a r e 2

Slide 3

Slide 3 text

What is Docker?

Slide 4

Slide 4 text

Docker Docker is a tool for building replicable environments for software in things called Images. It is a client server tool which uses a declarative model for specifying how you want to build the image. That declarative model is called a Dockerfile.

Slide 5

Slide 5 text

Here’s an example of how a containers architecture is like!

Slide 6

Slide 6 text

Containers CGROUP Lagos

Slide 7

Slide 7 text

Cgroups ⊄ Lagos

Slide 8

Slide 8 text

Cgroups can inherit other cgroups to form larger ones. This is what Docker uses to make containers talk to each other

Slide 9

Slide 9 text

Cgroup Features These are the features that Cgroups in general enforce.

Slide 10

Slide 10 text

Cgroups with Docker Notice docker can connect to both but the containers are individually separated. A general example of running multiple containers on Docker.

Slide 11

Slide 11 text

Types of Cgroups Memory CPU CPUset HugeTLB BLKIO DEV FREEZER NET_CLS NET_PRIO

Slide 12

Slide 12 text

Namespaces

Slide 13

Slide 13 text

Namespaces This is what prevents a container from seeing the things on your computer. Cgroups limit what you can use Namespaces limit what you can see

Slide 14

Slide 14 text

Namespaces There are various linux namespaces applicable for each process and each process is available in at least one namespace at a time.

Slide 15

Slide 15 text

Types of Cgroups PID NET MNT UTS IPC USER

Slide 16

Slide 16 text

Volumes

Slide 17

Slide 17 text

Volumes This is what Linux uses to access your local storage. Since the mnt namespace prevents the container from sharing the same storage space as your pc, you need to access container and local storage resources some way, we use volumes to do that.

Slide 18

Slide 18 text

Volume Drivers AUFS BTRFS DEVICE-MAPPER

Slide 19

Slide 19 text

Container Runtimes

Slide 20

Slide 20 text

Container Runtimes These are a set of tools that aim to simplify the low level process of setting up all the cgroup and namespace stuff on Linux and just get straight to running your containers. As much as you might think, Docker has it’s own container runtime which is just a subset of it’s tooling.

Slide 21

Slide 21 text

Container Containers existed before Docker. https://joejulian.name/post/kubernetes-container-engine-comparison/ As much as most people get mixed up, there a lot of tools that can do what Docker does, cause remember, cgroups and namespaces which power Docker are Linux-native and not a Docker construct. Docker simply takes out all the streinous tasks and automates it so you don’t have to

Slide 22

Slide 22 text

Container Runtimes RKT RUNC OPENVZ Docker LXC CRI Containerd

Slide 23

Slide 23 text

Resources Cgroups, Namespaces and all that https://www.youtube.com/watch?v=s K5i-N34im8&list=WL&index=24&t=91 9s Bash implementation of Docker look alike with cgroups and docker repository support https://github.com/p8952/bocker

Slide 24

Slide 24 text

Thanks!