Docker
Docker
Docker
Contents
Introduction to Containers
What is Docker?
Docker Architecture
Installing Docker
Docker Engine
Docker Images
Docker File
Docker Hub
Docker CLI
Kubernetes
Hands On Demo
Containers
LXC (Linux Containers) is an operating-system-level
virtualization method for running multiple isolated Linux
systems (containers) on a control host using a single Linux
kernel.
User DB
Do services and
appropriately?
Static website
apps interact
postgresql + pgv8 + v8
Queue Analytics DB
Multiplicity of
Redis + redis-sentinel
Web frontend
Background workers
Ruby + Rails + sass + Unicorn
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs +
phantomjs API endpoint
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client
Production Cluster
Development VM
environments
Multiplicity of
Public Cloud
hardware
smoothly and
Can I migrate
quickly?
QA server
Disaster recovery
Customer Data Center Contributors laptop
Production Servers
The Matrix From Hell
Static website ? ? ? ? ? ? ?
Web frontend ? ? ? ? ? ? ?
Background workers ? ? ? ? ? ? ?
User DB ? ? ? ? ? ? ?
Analytics DB ? ? ? ? ? ? ?
Queue ? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Solution: Intermodal Shipping Container
Do I worry about
next to spices)
Multiplicity of
Goods
Can I transport
transferred from one mode of
train to truck)
Multiplicity of
methods for
quickly and
transport to another
smoothly
ng
Docker is a shipping container system for
code
Static website User DB Web frontend Queue Analytics DB
Do services and
appropriately?
apps interact
Multiplicity of
Stacks
smoothly and
Can I migrate
hardware platform
quickly
Development QA server Customer Data Public Cloud Production Contributors
VM Center Cluster laptop
Docker eliminates the matrix from Hell
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
App A
App B
App B
App B
App A
App B
Docker
Container
Hypervisor (Type 2)
Bins/Libs Bins/Libs
Host OS Host OS
Server Server
Why are Docker containers lightweight?
VMs Containers
App App
App
App
App App A A A
A A
Bins/
Bins
Bins/ Bins/ Bins/
/
Libs Libs Libs Libs
Guest
OS
Guest Guest Guest Original App Copy of Modified App
OS OS OS (No OS to take App
up space, resources, No OS. Can Copy on write
or require restart) Share bins/libs capabilities allow
us to only save the
diffs
Between container
VMs A and container
Every app, every copy of an A
app, and every slight modification
of the app requires a new virtual server
What are the basics of the Docker system?
Push
Container A
Docker
Container
Image
Registry
Search Pull
Run
Build
Dockerfile
For
A
Container B
Container A
Container C
Docker
Source
Code
Repository Docker Engine
Host 1 OS (Linux)
Host 2 OS (Linux)
Changes and Updates
App Push
App
A
Docker
Bins/ Container
Bins
Libs Image
/
Registry
App
Container Mod A Mod A
Image Update
Bins
/
App
App
A
A
Bins/
Bins/
Bins
Libs
/
Libs
Docker Engine
Docker Engine
Host is now running A Host running A wants to upgrade to A.
Requests update. Gets only diffs
Ecosystem Support
Operating systems
Virtually any distribution with a 2.6.32+ kernel
Red Hat/Docker collaboration to make work across
RHEL 6.4+, Fedora, and other members of the
family (2.6.32 +)
CoreOSSmall core OS purpose built with Docker
OpenStack
Docker integration into NOVA (& compatibility with
Glance, Horizon, etc.) accepted for Havana release
Private PaaS
OpenShift
Solum (Rackspace, OpenStack)
Other TBA
Public PaaS
Deis, Voxoz, Cocaine (Yandex), Baidu PaaS
Ecosystem Support
Public IaaS
Native support in Rackspace, Digital Ocean,+++
AMI (or equivalent) available for AWS & other
DevOps Tools
Integrations with Chef, Puppet, Jenkins, Travis,
Salt, Ansible +++
Orchestration tools
Mesos, Heat, ++
Shipyard & others purpose built for Docker
Applications
1000s of Dockerized applications available at
index.docker.io
Use Cases
Use Case Examples
Build your own PaaS OpenSource PaaS built on Docker, Chef, and Heroku
Buildpacks
Web Based Environment for Instruction JiffyLab web based environment for the instruction, or
lightweight use of, Python and UNIX shell
Create Secure Sandboxes Docker makes creating secure sandboxes easier than ever
Example:
#Comment
FROM windowsservercore
COPY testfile.txt c:\
RUN dir c:\