1 of 37

L1051/L1052 - LINUX CONTAINER INTERNALS

How they really work

Scott McCarty, 5/21/2018

2 of 37

ARCHITECTURE

3 of 37

ARCHITECTURE

The Internet is WRONG :-)

Important corrections

  • Containers do not run ON docker. Containers are processes - they run on the Linux kernel. Containers are Linux.
  • The docker daemon is one of the many user space tools/libraries that talks to the kernel to set up containers

3

Scott McCarty, Twitter: @fatherlinux

4 of 37

Production-Ready Containers

What are the building blocks you need to think about?

4

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

5 of 37

TYPICAL ARCHITECTURE

Bringing it All Together

In distributed systems, the user must interact through APIs

5

Scott McCarty, Twitter: @fatherlinux

6 of 37

CONTAINERS ARE LINUX

The Libraries, and Data Structures

Userspace libraries interact with the kernel to isolate processes

  • Libraries
    • LXC, LXD, LibContainer, systemd nspawn, LibVirt
  • Kernel Data Structures
    • Name Spaces
    • Cgroups
    • SELinux

6

Scott McCarty, Twitter: @fatherlinux

7 of 37

THE USER SPACE TOOL CHAIN

On a Single Host

The user space tool chain adds the following:

  • A local daemon
  • Simple CLI/REST interface
  • Support for container images (OCI) and connection to registries

7

Scott McCarty, Twitter: @fatherlinux

8 of 37

THE ORCHESTRATION TOOLCHAIN

On Multiple Hosts

The orchestration toolchain adds the following:

  • More daemons (it’s a party) :-)
  • Scheduling across multiple hosts
  • Application Orchestration
  • Distributed builds (OpenShift)
  • Registry (OpenShift)

8

Scott McCarty, Twitter: @fatherlinux

9 of 37

THE COMMUNITY LANDSCAPE

Open Source, Leadership & Standards

The landscape is made up of committees, standards bodies, and open source projects:

  • Docker/Moby
  • Kubernetes/OpenShift
  • OCI Specifications
  • Cloud Native Technical Leadership

9

Scott McCarty, Twitter: @fatherlinux

10 of 37

OVERVIEW OF THE DIFFERENT STANDARDS

Vendor, Community, and Standards Body driven

Many different standards

10

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

11 of 37

WORKING TOGETHER

Standards in different places achieve different goals

Different standards are focused on different parts of the stack.

  • Container Images & Registries
  • Container Runtimes
  • Container Networking

11

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

12 of 37

CONTAINER IMAGES

13 of 37

Fancy Files

People forget about Glibc...

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

14 of 37

Container Images

Virtual machines and container environments

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

15 of 37

Fancy Files

Actually, they are layers...

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

16 of 37

Fancy File Servers

Actually, they are repositories

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

17 of 37

Fancy Files

How do we currently collaborate in the user space?

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

18 of 37

Fancy Files

The future of collaboration in the user space....

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

19 of 37

Fancy Files

The future of collaboration in the user space....

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

20 of 37

CONTAINER HOST

21 of 37

Fancy Processes

People forget about Glibc...

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

22 of 37

Linux Containers

Fancy Processes

Regular Linux Process

Containerized Process

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

23 of 37

Containerized Processes

Starting the process with namespaces, cgroups, and security controls

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

24 of 37

Containerized Processes

Starting the process in a namespace

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

25 of 37

Containerized Processes

The containerized process still use the underlying kernel abstractions...

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

26 of 37

Mounts

Copy on write vs. bind mounts

Scott McCarty Twitter: @fatherlinux Blog: bit.ly/fatherlinux

27 of 37

CONTAINER ORCHESTRATION

28 of 37

Application Containers

This is what most people think of with Docker

RED HAT AND CONTAINERS - CONFIDENTIAL - NDA REQUIRED

29 of 37

Container Orchestration

Multiple nodes changes everything

RED HAT AND CONTAINERS - CONFIDENTIAL - NDA REQUIRED

30 of 37

Container Orchestration

You can hack a solution together yourself, but it’s ugly...

RED HAT AND CONTAINERS - CONFIDENTIAL - NDA REQUIRED

31 of 37

Kubernetes/OpenShift

This Standardizes Everything

RED HAT AND CONTAINERS - CONFIDENTIAL - NDA REQUIRED

32 of 37

The Daemons

Bringing it All Together

User -> OpenShift -> Docker -> Kernel

32

Scott McCarty, Twitter: @fatherlinux

33 of 37

THE LOGIC

Bringing it All Together

33

Scott McCarty, Twitter: @fatherlinux

34 of 37

THANK YOU

plus.google.com/+RedHat

linkedin.com/company/red-hat

youtube.com/user/RedHatVideos

facebook.com/redhatinc

twitter.com/RedHatNews

35 of 37

AGENDA

10:15AM—10:25AM

INTRODUCTION

11:35AM—12:05PM

CONTAINER ORCHESTRATION

10:25AM—10:40AM

ARCHITECTURE

12:05PM—12:15PM

CONCLUSION

10:40AM—11:05AM

CONTAINER IMAGES

11:05AM—11:35PM

CONTAINER HOSTS

L103118 - Linux container internals

35

Scott McCarty, Twitter: @fatherlinux

36 of 37

Materials

The lab is made up of multiple documents and a GitHub repository

36

Scott McCarty, Twitter: @fatherlinux

37 of 37

CONTACT INFORMATION

We All Love Questions

  • Jamie Duncan: @jamieeduncan jduncan@redhat.com
  • Billy Holmes: @gonoph111 biholmes@redhat.com
  • John Osborne: @openshiftfed josborne@redhat.com
  • Scott McCarty: @fatherlinux smccarty@redhat.com

37

Scott McCarty, Twitter: @fatherlinux