SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Docker Introduction
Creating “batteries included” deployments
Contents
• Introduction to Docker, Containers, and the Matrix from Hell
• The Challenge, the Matrix From Hell
• Why Developers Care
• Technical Explanation
• Docker Compose
• Docker Machine
• Docker Swarm
• Learn More
Static website
Web frontend
User DB Queue
Analytics DB
Background workers API endpoint
nginx 1.5 + modsecurity +
openssl + bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Redis + redis-sentinel
Python 3.0 + celery + pyredis + libcurl
+ ffmpeg + libopencv + nodejs +
phantomjs
Python 2.7 + Flask + pyredis + celery +
psycopg + postgresql-client
DevelopmentVM
QA server
Public Cloud
Disaster recovery
Contributor’s laptopProduction Servers
The Challenge
Production Cluster
Customer Data Center
The Matrix From Hell
Static website ? ? ? ? ? ? ?
Web frontend ? ? ? ? ? ? ?
Background workers ? ? ? ? ? ? ?
User DB ? ? ? ? ? ? ?
Analytics DB ? ? ? ? ? ? ?
Queue ? ? ? ? ? ? ?
DevVM QA Server
Single Prod
Server
Onsite
Cluster
Public
Cloud
Contributor
laptop
Customer
Servers
Cargo Transport Pre-1960
Multiplicty of Goods
Can I transport quickly and smoothly from boat to train to truck?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Also a matrix from hell
Solution: Intermodal Shipping Container
…in between, can be loaded and
unloaded, stacked, transported
efficiently over long distances, and
transferred from one mode of
transport to another
A standard container that is
loaded with virtually any goods,
and stays sealed until it reaches
final delivery.
Static website Web frontendUser DB Queue Analytics DB
DevelopmentVM QA server Public Cloud Contributor’s laptop
Docker is a shipping container system for code
Production
Cluster
Customer
Data Center
…that can be manipulated using
standard operations and run
consistently on virtually any hardware
platform
An engine that enables any
payload to be encapsulated as a
lightweight, portable, self-
sufficient container…
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Development
VM
QA Server
Single Prod
Server
Onsite
Cluster
Public Cloud
Contributor’s
laptop
Customer
Servers
Docker eliminates the matrix from Hell
I am at customer and am
having trouble running our web
application
Is there any messages in the log
file?
Nothing, It’s only a few KB in
size. I will send it to you.
Wierd, but Tomcat is up?
I get a 404 when accessing it.
Postgres doesn’t have any tables
yet.
Sounds like Tomcat didn’t
properly deploy the app.
2 Hours of Additional
Troubleshooting
I noticed that tomcat is picking
up an old version of java 7
We require JDK 8
18
Why Developers Care?
Build once…finally run anywhere
• A clean, safe, hygienic and portable runtime environment for your app.
• No worries about missing dependencies, packages and other pain points
during subsequent deployments
• Run each app in its own isolated container, so you can run various
versions of libraries and other dependencies for each app without worrying
• Automate testing, integration, packaging..anything you can script
• Reduce/eliminate concerns about compatibly on different platforms, either
your own or your customers.
• Cheap, zero-penalty containers to deploy services? A VM without the
overhead of a VM? Instant replay and reset of image snapshots? Thats
the power fo Docker.
Why DevOps Cares?
Configure Once…Run Anything
• Make the entire lifecycle more efficient, consistent, and repeatable
• Increase the quality of code produced by developers.
• Eliminate inconsistencies between development, test, production, and
customer environments.
• Support segregation of duties.
• Significantly improve the speed and reliability of continuous
deployment and integration systems.
• Because the containers are so lightweight, address significant
performance, costs, deployment, and portability issues normally
associated with VMs.
Why it works—separation of concerns
Dan the Developer
• Worries about whats “inside”
the container
• His code
• His Libraries
• His Package Manager
• His Apps
• His Data
Oscar the Ops Guy
• Worries about what’s “outside”
the container
• Logging
• Remote Access
• Monitoring
• Network Config
• All Containers, start, stop,
copy, attach, migrate, etc. the
same way
Why it Works?
• Run everywhere
• Regardless of kernel version
• Regardless of host distort
• Physical or virtual, cloud or not
• Run anything
• If it can run on the host, it can run in the container
• i.e. if it can run on a linux kernel, it can run.
• High Level - Its a lightweight VM
• Own process space
• Own network interface
• Can run stuff as root
• Can have its own /sbin/init (different from host)
Why are Docker containers lightweight?
Bins/
Libs
App
A
Original App
(No OS to take
up space, resources,
or require restart)
AppΔ
App
A
Bins/
Libs
App
A’
Bins/
Libs
Modified
App
Copy on write capabilities
allow
us to only save the diffs
Between container A and
container
A’VMs
Every app, every copy of an
app, and every slight modification
of the app requires a new virtual server
App
A
Guest
OS
Bins/
Libs
Copy of
App
No OS. Can
Share bins/libs
App
A
Guest
OS
Guest
OS
VMs Containers
What are the basics of the Docker system?
Source Code
Repository
Dockerfile
For
A
Docker Engine
Docker
Container
Image
Registry
Build
Docker
Host 2 OS (Linux)
ContainerA
ContainerB
ContainerC
ContainerA
Push
Search
Pull
Run
Host 1 OS (Linux)
Changes and Updates
Bins/
Libs
App
A
Base
Container
Image
Base
Container
Image
AppΔ
Libs
Container
Mod A’’
Container
Mod A’
Docker
Container
Image
Registry
Docker Engine
Bins/
Libs
App
A
Docker Engine
Bins/
Bins/
Libs
App
A’’
Host is now running
A’’
Host running A wants to upgrade to A’’.
Requests update. Gets only diffs
Multiple Linked Containers
• Containers can be linked together
• Sets environment values and host entries so containers
can speak to each other over a local network.
docker pull redis:latest
docker build -t web .
docker run -d --name=db redis:latest redis-server --appendonly yes
docker run -d --name=web --link:db:db -p 5000:5000 -v `pwd`:/code python
app.py
This is still too hard, typing
commands with lots of
arguments takes too long.
Docker Compose
• Multi Container Applications are a Hassle
• Build an Image from Dockerfiles
• Pull images from Docker Hub or a private registry
• Configure, start and Stop containers
docker pull redis:latest
docker build -t web .
docker run -d --name=db redis:latest redis-server --appendonly yes
docker run -d --name=web --link:db:db -p 5000:5000 -v `pwd`:/code python
app.py
Docker Compose
• Docker Compose gets your multi container app running
in one command
docker-compose up
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
links:
- redis
redis:
image: redis
Scaling with Docker
Compose
docker-compose scale worker=2
spark
worker
spark master
spark
worker
Scaling with Docker
Compose
docker-compose scale worker=4
spark
worker
spark master
spark
worker
spark
worker
spark
worker
Docker Machine
• Single Binary to create a remote Docker host and setup
the TLS communication with your local docker client
• Automates TLS setup for accessing remote docker
daemon
• Manage multiple machines in different clouds at the
same time
Cloud Ready Deployment
• Docker Machine includes drivers for
• Virtual Box
• VM Ware
• Amazon EC2
• Google Compute
• Digital Ocean
• Many More…
Creating a local Docker Host
$:docker-machine create --driver virtualbox --virtualbox-memory "8000" dev
$:docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM
dev virtualbox Running tcp://192.168.99.100:2376
dockerbig * amazonec2 Running tcp://10.0.1.10:2376
$:docker-machine env dev
export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.99.100:2376"
export DOCKER_CERT_PATH="/Users/jellin/.docker/machine/machines/dev"
export DOCKER_MACHINE_NAME=“dev"
# Run this command to configure your shell:
# eval "$(docker-machine env dev)"
Docker Swarm
• Native Clustering for Docker hosts
• Dynamically spread container load among multiple
hosts.
• multiple strategies available for ranking node utilization
and availability
• Can integrate with docker machine and api’s such as
Dokku to dynamically allocate additional Docker hosts
as needed.
• Swarm Coordinator run as a container

Contenu connexe

Tendances

Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
John Willis
 

Tendances (20)

Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Midi technique - présentation docker
Midi technique - présentation dockerMidi technique - présentation docker
Midi technique - présentation docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management services
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Docker basics
Docker basicsDocker basics
Docker basics
 
Docker Containers Deep Dive
Docker Containers Deep DiveDocker Containers Deep Dive
Docker Containers Deep Dive
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Docker intro
Docker introDocker intro
Docker intro
 

En vedette

Why Docker
Why DockerWhy Docker
Why Docker
dotCloud
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 

En vedette (6)

Docker with openstack
Docker with openstackDocker with openstack
Docker with openstack
 
Introduction à docker.io
Introduction à docker.ioIntroduction à docker.io
Introduction à docker.io
 
Présentation Docker
Présentation DockerPrésentation Docker
Présentation Docker
 
Why Docker
Why DockerWhy Docker
Why Docker
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
Docker en Production (Docker Paris)
Docker en Production (Docker Paris)Docker en Production (Docker Paris)
Docker en Production (Docker Paris)
 

Similaire à Docker Introduction

Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly
 
Docker intro
Docker introDocker intro
Docker intro
spiddy
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
Docker, Inc.
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
Docker, Inc.
 
Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
sflynn073
 

Similaire à Docker Introduction (20)

OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 
Docker
DockerDocker
Docker
 
Webinar Docker Tri Series
Webinar Docker Tri SeriesWebinar Docker Tri Series
Webinar Docker Tri Series
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
 
Docker intro
Docker introDocker intro
Docker intro
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
Intro to Docker October 2013
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
DockerCon EU 2015 Barcelona
DockerCon EU 2015 BarcelonaDockerCon EU 2015 Barcelona
DockerCon EU 2015 Barcelona
 
Intro to Docker November 2013
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
 
Was liberty profile and docker
Was liberty profile and dockerWas liberty profile and docker
Was liberty profile and docker
 
WebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and DockerWebSphere Application Server Liberty Profile and Docker
WebSphere Application Server Liberty Profile and Docker
 

Dernier

Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Monica Sydney
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
ydyuyu
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
ydyuyu
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Monica Sydney
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Monica Sydney
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 

Dernier (20)

Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi EscortsRussian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
Russian Escort Abu Dhabi 0503464457 Abu DHabi Escorts
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
哪里办理美国迈阿密大学毕业证(本硕)umiami在读证明存档可查
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi EscortsIndian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
Indian Escort in Abu DHabi 0508644382 Abu Dhabi Escorts
 
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girlsRussian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
Russian Call girls in Abu Dhabi 0508644382 Abu Dhabi Call girls
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
Microsoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck MicrosoftMicrosoft Azure Arc Customer Deck Microsoft
Microsoft Azure Arc Customer Deck Microsoft
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Power point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria IuzzolinoPower point inglese - educazione civica di Nuria Iuzzolino
Power point inglese - educazione civica di Nuria Iuzzolino
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 

Docker Introduction

  • 2. Contents • Introduction to Docker, Containers, and the Matrix from Hell • The Challenge, the Matrix From Hell • Why Developers Care • Technical Explanation • Docker Compose • Docker Machine • Docker Swarm • Learn More
  • 3. Static website Web frontend User DB Queue Analytics DB Background workers API endpoint nginx 1.5 + modsecurity + openssl + bootstrap 2 postgresql + pgv8 + v8 hadoop + hive + thrift + OpenJDK Ruby + Rails + sass + Unicorn Redis + redis-sentinel Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client DevelopmentVM QA server Public Cloud Disaster recovery Contributor’s laptopProduction Servers The Challenge Production Cluster Customer Data Center
  • 4. The Matrix From Hell Static website ? ? ? ? ? ? ? Web frontend ? ? ? ? ? ? ? Background workers ? ? ? ? ? ? ? User DB ? ? ? ? ? ? ? Analytics DB ? ? ? ? ? ? ? Queue ? ? ? ? ? ? ? DevVM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor laptop Customer Servers
  • 5. Cargo Transport Pre-1960 Multiplicty of Goods Can I transport quickly and smoothly from boat to train to truck?
  • 6. ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Also a matrix from hell
  • 7. Solution: Intermodal Shipping Container …in between, can be loaded and unloaded, stacked, transported efficiently over long distances, and transferred from one mode of transport to another A standard container that is loaded with virtually any goods, and stays sealed until it reaches final delivery.
  • 8. Static website Web frontendUser DB Queue Analytics DB DevelopmentVM QA server Public Cloud Contributor’s laptop Docker is a shipping container system for code Production Cluster Customer Data Center …that can be manipulated using standard operations and run consistently on virtually any hardware platform An engine that enables any payload to be encapsulated as a lightweight, portable, self- sufficient container…
  • 9. Static website Web frontend Background workers User DB Analytics DB Queue Development VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor’s laptop Customer Servers Docker eliminates the matrix from Hell
  • 10. I am at customer and am having trouble running our web application
  • 11. Is there any messages in the log file?
  • 12. Nothing, It’s only a few KB in size. I will send it to you.
  • 14. I get a 404 when accessing it. Postgres doesn’t have any tables yet.
  • 15. Sounds like Tomcat didn’t properly deploy the app.
  • 16. 2 Hours of Additional Troubleshooting
  • 17. I noticed that tomcat is picking up an old version of java 7
  • 19. Why Developers Care? Build once…finally run anywhere • A clean, safe, hygienic and portable runtime environment for your app. • No worries about missing dependencies, packages and other pain points during subsequent deployments • Run each app in its own isolated container, so you can run various versions of libraries and other dependencies for each app without worrying • Automate testing, integration, packaging..anything you can script • Reduce/eliminate concerns about compatibly on different platforms, either your own or your customers. • Cheap, zero-penalty containers to deploy services? A VM without the overhead of a VM? Instant replay and reset of image snapshots? Thats the power fo Docker.
  • 20. Why DevOps Cares? Configure Once…Run Anything • Make the entire lifecycle more efficient, consistent, and repeatable • Increase the quality of code produced by developers. • Eliminate inconsistencies between development, test, production, and customer environments. • Support segregation of duties. • Significantly improve the speed and reliability of continuous deployment and integration systems. • Because the containers are so lightweight, address significant performance, costs, deployment, and portability issues normally associated with VMs.
  • 21. Why it works—separation of concerns Dan the Developer • Worries about whats “inside” the container • His code • His Libraries • His Package Manager • His Apps • His Data Oscar the Ops Guy • Worries about what’s “outside” the container • Logging • Remote Access • Monitoring • Network Config • All Containers, start, stop, copy, attach, migrate, etc. the same way
  • 22. Why it Works? • Run everywhere • Regardless of kernel version • Regardless of host distort • Physical or virtual, cloud or not • Run anything • If it can run on the host, it can run in the container • i.e. if it can run on a linux kernel, it can run. • High Level - Its a lightweight VM • Own process space • Own network interface • Can run stuff as root • Can have its own /sbin/init (different from host)
  • 23. Why are Docker containers lightweight? Bins/ Libs App A Original App (No OS to take up space, resources, or require restart) AppΔ App A Bins/ Libs App A’ Bins/ Libs Modified App Copy on write capabilities allow us to only save the diffs Between container A and container A’VMs Every app, every copy of an app, and every slight modification of the app requires a new virtual server App A Guest OS Bins/ Libs Copy of App No OS. Can Share bins/libs App A Guest OS Guest OS VMs Containers
  • 24. What are the basics of the Docker system? Source Code Repository Dockerfile For A Docker Engine Docker Container Image Registry Build Docker Host 2 OS (Linux) ContainerA ContainerB ContainerC ContainerA Push Search Pull Run Host 1 OS (Linux)
  • 25. Changes and Updates Bins/ Libs App A Base Container Image Base Container Image AppΔ Libs Container Mod A’’ Container Mod A’ Docker Container Image Registry Docker Engine Bins/ Libs App A Docker Engine Bins/ Bins/ Libs App A’’ Host is now running A’’ Host running A wants to upgrade to A’’. Requests update. Gets only diffs
  • 26. Multiple Linked Containers • Containers can be linked together • Sets environment values and host entries so containers can speak to each other over a local network. docker pull redis:latest docker build -t web . docker run -d --name=db redis:latest redis-server --appendonly yes docker run -d --name=web --link:db:db -p 5000:5000 -v `pwd`:/code python app.py
  • 27. This is still too hard, typing commands with lots of arguments takes too long.
  • 28. Docker Compose • Multi Container Applications are a Hassle • Build an Image from Dockerfiles • Pull images from Docker Hub or a private registry • Configure, start and Stop containers docker pull redis:latest docker build -t web . docker run -d --name=db redis:latest redis-server --appendonly yes docker run -d --name=web --link:db:db -p 5000:5000 -v `pwd`:/code python app.py
  • 29. Docker Compose • Docker Compose gets your multi container app running in one command docker-compose up web: build: . ports: - "5000:5000" volumes: - .:/code links: - redis redis: image: redis
  • 30. Scaling with Docker Compose docker-compose scale worker=2 spark worker spark master spark worker
  • 31. Scaling with Docker Compose docker-compose scale worker=4 spark worker spark master spark worker spark worker spark worker
  • 32. Docker Machine • Single Binary to create a remote Docker host and setup the TLS communication with your local docker client • Automates TLS setup for accessing remote docker daemon • Manage multiple machines in different clouds at the same time
  • 33. Cloud Ready Deployment • Docker Machine includes drivers for • Virtual Box • VM Ware • Amazon EC2 • Google Compute • Digital Ocean • Many More…
  • 34. Creating a local Docker Host $:docker-machine create --driver virtualbox --virtualbox-memory "8000" dev $:docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM dev virtualbox Running tcp://192.168.99.100:2376 dockerbig * amazonec2 Running tcp://10.0.1.10:2376 $:docker-machine env dev export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.99.100:2376" export DOCKER_CERT_PATH="/Users/jellin/.docker/machine/machines/dev" export DOCKER_MACHINE_NAME=“dev" # Run this command to configure your shell: # eval "$(docker-machine env dev)"
  • 35. Docker Swarm • Native Clustering for Docker hosts • Dynamically spread container load among multiple hosts. • multiple strategies available for ranking node utilization and availability • Can integrate with docker machine and api’s such as Dokku to dynamically allocate additional Docker hosts as needed. • Swarm Coordinator run as a container