Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Containers All The Way Down

morhekil
March 27, 2015

Containers All The Way Down

Talk about building blocks of modern containers
(from chroot to AuFS). Introduction to Docker with Ruby+Redis
container examples, and docker-compose workflow.

Source code and more details: https://github.com/morhekil/talks-and-slides/tree/master/containers

morhekil

March 27, 2015
Tweet

More Decks by morhekil

Other Decks in Technology

Transcript

  1. Why virtualise? VERY LOW infrastructure utilisation · 5% - McKinsey's

    Data Center study, 2008 · 8% - Accenture paper, 2011 · 12% - Gartner, 2012
  2. Hypervisors first mentioned in 1965, for IBM's system. · 1988

    - first SoftPC for Macintosh; can only run DOS, later - Win 3.x, 9x · 1997 - Connectix VirtualPC for Macintosh, later sold to Microsoft
  3. Hypervisors · 2001 - VMWare GSX Server, x86 Windows; Connectix

    VirtualPC for Windows · 2003 - Xen, open-source hypervisor · 2005 - free VMWare Player · 2006 - VMWare Server, free Microsoft VirtualPC · 2007 - VirtualBox Open Source Edition
  4. Containers guest OS can only be of the same kind

    (e.g. Windows or Linux) as the host OS.
  5. chroot 4.4BSD-Lite - sys/kern/vfs_syscalls.c chroot(p, uap, retval) // ... {

    register struct filedesc *fdp = p->p_fd; int error; struct nameidata nd; if (error = suser(p->p_ucred, &p->p_acflag)) return (error); NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, uap->path, p); if (error = change_dir(&nd, p)) return (error); if (fdp->fd_rdir != NULL) vrele(fdp->fd_rdir); fdp->fd_rdir = nd.ni_vp; return (0); }
  6. · 1982 - chroot (4.2BSD) (filesystem view only) · 2000

    - FreeBSD jail (fs + users, socket and process interaction restrictions) · 2001 - Linux-VServer (with a kernel patch) · 2005 - Solaris Zones (allow dedicated CPU, RAM, net-if controls, plus ZFS-powered features - snapshots and cloning) · 2005 - OpenVZ - by SWSoft, aka Parallels (with a kernel patch)
  7. · 2008 - LXC · 2013 - lmctfy (Google's set

    of tools controlling cgroups) · 2013 - Docker (leverages Linux cgroups and namespaces - first via LXC, then libcontainer)
  8. Docker Toolset and ecosystem · base images · public registry

    · standard containers · third-party tools and workflows
  9. Docker on OSX boot2docker > brew install boot2docker > boot2docker

    help > boot2docker init > boot2docker start
  10. References · A Dive into Docker · The Docker Ecosystem

    · The Docker Book · Docker in Practice