Top Banner
How Docker didn't invent containers Docker Meetup Prague Pavel Šnajdr vpsFree.cz
26

How Docker didn't invent containers - vpsFree.cz

Feb 27, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How Docker didn't invent containers - vpsFree.cz

How Docker didn't invent containers

Docker Meetup Prague

Pavel ŠnajdrvpsFree.cz

Page 2: How Docker didn't invent containers - vpsFree.cz

Contents

Containers vs. HypervisorsHistory of CT tech

OpenVZContainers in vanilla kernel

Managing containersHow Docker fits in the pictureConclusions

Page 3: How Docker didn't invent containers - vpsFree.cz

whoami

● vpsFree.cz● Container based VPS community/provider● Founder, admin, base OS dev/QA● Now full-time

● Formerly Relbit CTO

● Working with containers in prod since 2009

Page 4: How Docker didn't invent containers - vpsFree.cz

Hypervisors

HW

Hypervisor

Kernel Kernel Kernel Kernel

Init

Libraries

Apps

Init

Libraries

Apps

Init

Libraries

Apps

Init

Libraries

Apps

Page 5: How Docker didn't invent containers - vpsFree.cz

OS Containers

HW

Kernel

Init

Libraries

Apps

Init

Libraries

Apps

Init

Libraries

Apps

Init

Libraries

Apps

Page 6: How Docker didn't invent containers - vpsFree.cz

Application containers

HW

Kernel

Libraries

App

Libraries

App

Libraries

App

Libraries

App

Page 7: How Docker didn't invent containers - vpsFree.cz

Application containers

HW

Kernel

Libraries

App App App App

Page 8: How Docker didn't invent containers - vpsFree.cz

1998: FreeBSD Jails

● FreeBSD 4.0● Resource management very limited● Origins: a small webhosting company

Page 9: How Docker didn't invent containers - vpsFree.cz

2001: SWSoft Virtuozzo 2.0

● Started in 1999● Groups of processes with namespace isolation● FS to share code and save RAM● Resources management

● SWSoft -> Parallels

● Also in 2001 linux-vserver● Mostly one-man show

Page 10: How Docker didn't invent containers - vpsFree.cz

2004

● Solaris Containers released (“Zones”)● Virtuozzo for Windows

● Live kernel patching

Page 11: How Docker didn't invent containers - vpsFree.cz

2005

● OpenVZ project● Namespaces (PID, mnt, UTS, net, IPC)● UBC● vzquota● vzctl

● Goal set to upstream containers(“better late than never”)

Page 12: How Docker didn't invent containers - vpsFree.cz

2006

● OpenVZ live migration● Rebase to RHEL4 kernel

Page 13: How Docker didn't invent containers - vpsFree.cz

2007

● IBM AIX WPARs, HP-UX SRP containers

● OpenVZ rebase to RHEL5● Also 2.6.20 port

● cgroups upstreamed (Google & IBM)

Page 14: How Docker didn't invent containers - vpsFree.cz

2008

● OpenVZ namespaces upstreaming● PID, net, IPC, UTS, mnt

● LXC

Page 15: How Docker didn't invent containers - vpsFree.cz

2010

● OpenVZ● Rebase to RHEL6 kernel● VSwap (simplified UBC)● ploop (CT-in-a-file)

● on-demand allocation● instant snapshots● online resize, compact, merge● write tracker

Page 16: How Docker didn't invent containers - vpsFree.cz

2011

● CRIU proposed● Checkpoint: get stuff from /proc debug fac.● Restore: read dump & recreate environment

● LinuxCon 2011 Prague● “There can be only one”

... container tech in vanilla● Avoid Xen vs. KVM mess

Page 17: How Docker didn't invent containers - vpsFree.cz

2012

● CRIU 0.1 released● vzctl 4.0 with support for upstream kernel

Page 18: How Docker didn't invent containers - vpsFree.cz

2013

● Docker● lmctfy● CoreOS● vzctl adds IO limits● user namespace in vanilla

Page 19: How Docker didn't invent containers - vpsFree.cz

2014

● vzctl 4.8, faster live migration● Parallels announce PCS and OpenVZ to merge

into common open-source code-base

Page 20: How Docker didn't invent containers - vpsFree.cz

2015

● OpenVZ RHEL7 kernel beta● CRIU for migration● cgroups replacing UBC● vzctl not compatible yet● public Git repo

http://src.openvz.org/

Page 21: How Docker didn't invent containers - vpsFree.cz

OpenVZ and Docker

● Docker insidehttps://openvz.org/Docker_inside_CT

● Docker outsidehttps://github.com/docker/libcontainer/pull/434

● Docker and CRIU● Merged in libcontainer

Page 22: How Docker didn't invent containers - vpsFree.cz

Containers in vanilla kernel

● Any of (cgroups + namespaces) = container

● Cgroups (blkio, cpu, cpuacct, cpuset, devices, freezer, ns)

● Namespaces (user, net, PID, UTS, mnt, IPC)

Page 23: How Docker didn't invent containers - vpsFree.cz

Container management tools

● LXC● LXD● Docker● libvirt-lxc● systemd-nspawn● vzctl● lmctfy● libct

https://github.com/xemul/libct ● “Libvirt for containers”

Page 24: How Docker didn't invent containers - vpsFree.cz

Docker and containers

Page 25: How Docker didn't invent containers - vpsFree.cz

Conclusions

● Containers != Docker● Docker = single (very) limited way of using

container tech for apps deployment● Reinvent the wheel approach... (PID #1, logs...)

● Most mature container tech = OpenVZ● Best isolation (eg. Kmem)● Most features

● Do you actually want Docker or containers?

Page 26: How Docker didn't invent containers - vpsFree.cz

Q/A

● Questions?

Anytime -> [email protected]