Skip to content

Latest commit

 

History

History
132 lines (93 loc) · 2.93 KB

lnl-container.md

File metadata and controls

132 lines (93 loc) · 2.93 KB

footer: June 12, 2020 slidenumbers: true

What is a container?

Lunch and Learn series - remote edition

Nick Brandaleone AWS Specialist SA - Containers


Ground Rules


Agenda

Lesson Time
Why are containers so popular? 5 minutes
What is the magic? 5 minutes
Demo, using BASH 20 minutes
Firecracker demo 5 minutes

Why so popular?

  • Code portability issue is solved
  • Faster start-up time makes them preferrable to VMs
  • Greater hardware efficiency makes them cheaper
  • Isolation provides security (not perfect though)
  • Docker tooling is easy to use

What is the magic?

Containers do not really exist

  • Namespaces
  • cgroups (Linux capabilities + Seccomp)
  • COW or layered filesystem

Linux Kernel tricks - Windows should use .Net Core


Namespaces

CGROUP - limit cpu/memory for a group of processes. MNT: It allows a process to have its own filesystem. PID: The pid namespace gives a process its own view of /proc. NET: Isolated network stack. UTS: System’s hostname and domain name. USER: The user namespace maps the uids to different uids. IPC: message queues and shared memory.


Cgroups

Where namespaces isolate a process, cgroups enforce fair resource sharing between processes.

For example:

  • how much memory a process can use
  • how much CPU can a process use
  • how many children processes can be spawned

Layered Filesystem

  • Layered Filesystems are how we can efficiently move whole machine images around.

  • Also known as tarballs...

  • Storage Drivers:

    • overlay2
    • aufs (older version)

Vocabulary

  • Docker -> the company that made it easy to use containers. Purchased by Mirantis in late 2019.
  • OCI -> The open source components of Docker
    • containerd (high-level interface)
    • runc (low level)

How they fit together

inline


Under the hood

No fork() and exec()

We now clone() or unshare()

Docker and Kubernetes are written in Go, not C


[fit] Demo time!


Thank you

Stay Safe and Sane


Resources:


Videos:


Workshops