INTRODUCTION TO DOCKER
ST. LOUIS DOCKER MEETUP
!
JANUARY 8, 2013
Steven Borrelli
[email protected]
@stevendborrelli {github, twitter}
Slide 2
Slide 2 text
STL Machine Learning
!
!
Anupam Basu: Visualizing
Shakespeare
!
Wednesday, January 22, 2014
Jeremy Kohler: Using GIS in
Investigative Reporting
Tuesday, February 18, 2014
Jeff Heaton: Neural Networks
Wednesday March 19, 2014
Slide 3
Slide 3 text
THE HYPE
Slide 4
Slide 4 text
DOCKER HISTORY
A dotCloud (PAAS provider) project
Initial commit January 18, 2013
Docker 0.1.0 released March 25, 2013
8,800+ github stars, 1,200+ forks
Slide 5
Slide 5 text
WHAT IS DOCKER?
!
“Docker is an open-source project to easily create
lightweight,
portable,
self-sufficient
containers
from any application.”
Slide 6
Slide 6 text
LIGHTWEIGHT
!
Based on Linux containers
Minimal overhead (cpu/io/network)
Uses layered filesystem to save space (AUFS/LVM)
Uses a copy-on-write filesystem to track changes
Slide 7
Slide 7 text
PORTABLE
A Docker container will run on any Linux system that
supports LXC.
Raspberry pi support.
Future plans to support other container tools
(lmctfy, etc.)
Possible future support for other operating systems
(Solaris, OSX, Windows?)
Slide 8
Slide 8 text
SELF-SUFFICIENT
A Docker container contains everything it needs to run:
!
Minimal Base OS
Libraries and frameworks
Application code
!
A docker container should be able to run anywhere that
Docker can run.
Slide 9
Slide 9 text
LINUX KERNEL
LAYER FS
CGROUPS NAMESPACES
LXC
DOCKER
DOCKER ARCHITECTURE
HARDWARE VIRTUALIZATION
1966-1972 IBM CP/CMS
1989 Insignia SoftPC
1997 Connectix VirtualPC
1999 VMWare Workstation
2001 IBM AIX LPAR
2002 Xen
2006 Amazon EC2
2007 Sun Logical Domains
2007 Linux KVM
2007 InnoTek VirtualBox
2008 Microsoft Hyper-V
Slide 13
Slide 13 text
Glauber Costa/LinuxCon 2012
“I once heard that hypervisors are the living
proof of operating system's incompetence.”
Slide 14
Slide 14 text
CONTAINERS
http://www.docker.io/the_whole_story/
Slide 15
Slide 15 text
PROCESS VIRTUALIZATION
1979-1982 UNIX Chroot
1998 FreeBSD Jail
2001 Parallels Virtuozzo
2001 Linux-VServer
2005 Solaris Zones
2005 OpenVZ
2008 Linux LXC
2007+
PAAS:
Heroku, Joyent, CloudFoundry
2013 Docker
Slide 16
Slide 16 text
RUNNING DOCKER
Slide 17
Slide 17 text
PULLING AN IMAGE
Slide 18
Slide 18 text
STARTING A CONTAINER
Mapping host volumes to a container
Slide 19
Slide 19 text
MAPPING PORTS
Example: run Zookeeper + Exhibitor
Host ports will be dynamically allocated by docker
Port 2181 on host will be mapped to 2181 on container
Slide 20
Slide 20 text
LXC UNDER THE HOOD
Slide 21
Slide 21 text
COMMITTING CHANGES
Commit changes to a new image
Run the new container
Make changes to a running container
Slide 22
Slide 22 text
EXAMPLE: INSTALL NODE.JS
Slide 23
Slide 23 text
IMAGES ARE A GRAPH
Slide 24
Slide 24 text
IMMUTABLE SERVERS
Physical server lifetime is measured in
years.
A container's lifetime can only be a few
seconds.
Treat containers like a build artifact.
If you need to make changes, build a new
container.
Slide 25
Slide 25 text
DOCKERFILES
AUTOMATING BUILDS
Slide 26
Slide 26 text
DOCKERFILES
AUTOMATING BUILDS
Slide 27
Slide 27 text
BUILDING AND RUNNING
Build node container and and app container
Run your app, and get the port:
https://github.com/stevendborrelli/docker-meetup
Slide 28
Slide 28 text
BUILDING AND RUNNING
Stop/Start your container
Slide 29
Slide 29 text
SUMMARY
Easy to build, run & share containers
Rapidly expanding ecosystem
Better performance vs. VMs
Layered filesystem gives us git-like control of images.
Reduces complexity of system builds
Slide 30
Slide 30 text
THE FUTURE IS EXCITING
Lean base operating systems optimized for containers
Slide 31
Slide 31 text
THE FUTURE IS EXCITING
New operational models:
Automated routing
Distributed consensus (Paxos, Raft)
Service Discovery
Software Defined Networking
Distributed scheduling (Mesos)