The challenge of application distribution - Introduction to Docker (2014 dec 03)

Sébastien Portebois
The challenge of application 
distribution 
Introduction to Docker
Credits & references 
Intros slides borrowed from 
• dotCloud’s « Docker introduction » slideshow 
• AWS re:Invent 2014 session APP303, « Lighting Fast Deploys with 
Docker Containers and AWS »
Agenda 
• The application distribution challenge 
• The current solutions 
• Introduction to Docker, Containers, and the Matrix from Hell 
• Why people care: Separation of Concerns 
• Technical Discussion 
• Ecosystem, momentum 
• How to build Docker images 
• How to make containers talk to each other, how to handle data 
persistence 
• Demo 1: isolation 
• Demo 2: real case - installing Go Math!, tail –f containers, unit 
tests
The challenge
The challenge: apps have fundamentally changed 
~2000 2014 
Long lived Development is iterative and 
constant 
Monolithic and built on a 
single stack 
Built from loosely coupled 
components 
Deployed to a single server Deployed to a multitude of 
servers
Everybody already heard/said it:
The challenge: apps have fundamentally changed 
Static website 
User DB 
Redis + redis-sentinel 
Web frontend 
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 
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + 
nodejs + phantomjs 
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client 
Development VM 
QA server 
Public Cloud 
Disaster recovery 
Contributor’s laptop 
Production Servers 
Multiplicity of 
Stacks 
Multiplicity of 
hardware 
environments 
Production Cluster 
Customer Data Center 
Do services and 
apps interact 
appropriately? 
Can I migrate 
smoothly and 
quickly?
The Matrix From Hell 
Static website 
Web frontend 
Background workers 
User DB 
Analytics DB 
Queue 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
Dev VM QA Server 
Single Prod 
Server 
Onsite 
Cluster 
Public Cloud 
Contributor’s 
laptop 
Customer 
Servers
The current solutions
Current solutions 
• ‘Configuration’ tools like Ansible, Chef, Puppet, … 
• VM tools : Vagrant 
• Container tools: Google’s LMCTFY
Goods 
Multiplicity of 
transporting/storing 
Multipilicity of 
methods for 
Do I worry about 
how goods 
interact (e.g. 
coffee beans next 
to spices) 
Can I transport 
quickly and 
smoothly 
(e.g. from boat to 
train to truck) 
Cargo Transport Pre-1960
Also a matrix from hell 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ? 
? ? ? ? ? ? ?
Multiplicity of 
Goods 
Multiplicity of 
methods for 
transporting/storin 
g 
Do I worry about 
how goods 
interact (e.g. 
coffee beans next 
to spices) 
Can I transport 
quickly and 
smoothly 
(e.g. from boat to 
train to truck) 
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.
Containers applied to software
Static website User DB Web frontend Queue Analytics DB 
Dev VM 
QA server Public Cloud 
Contributor’s 
laptop 
Docker is a shipping container system for code 
Multiplicity of 
Stacks 
Multiplicity of 
hardware 
environments 
Production 
Cluster 
Customer Data 
Center 
Do services and 
apps interact 
appropriately? 
Can I migrate 
smoothly and 
quickly 
…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 
Dev VM QA Server 
Single Prod 
Server 
Onsite 
Cluster 
Public Cloud 
Contributor’s 
laptop 
Customer 
Servers 
Docker eliminates the matrix from Hell
Good for developers 
• 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 compatibility 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? That’s the power of Docker 
* Anywhere = any x86 server running a modern Linux kernel (3.2+ generally. 2.6.32+ for RHEL 6.5+, Fedora, & 
related)
Good for (Dev)Ops 
• 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 improves the speed and reliability of continuous deployment and 
continuous 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 what’s “inside” the 
container 
• His code 
• His Libraries 
• His Package Manager 
• His Apps 
• His Data 
– All Linux servers look the same 
• 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
Under the hood 
• To learn more about how it works, some background: 
–Linux namespaces 
• PID 
• IPTables 
• UTS (~hostname) 
• Mount 
• IPC (inter-process) 
–CGroups 
–LXC Containers
Containers vs. VMs 
App 
A 
Bins 
/ 
Libs 
Bins 
/ 
Libs 
Bins 
/ 
Libs 
Hypervisor (Type 2) 
Host OS 
Server 
Guest 
OS 
App 
A’ 
Gues 
t 
OS 
App 
B 
Gues 
t 
OS 
App A’ 
Docker 
Host OS 
Server 
App A 
Bins/Libs 
Bins/Libs 
App B 
App B’ 
App B’ 
App B’ 
VM 
Container 
Containers are isolated, 
but share OS and, where 
appropriate, bins/libraries 
Guest 
OS 
Guest 
OS 
…result is significantly faster 
deployment, much less overhead, 
easier migration, faster restart
Why are Docker containers lightweight? 
VMs Containers 
App 
A 
Bins 
/ 
Libs 
Original App 
(No OS to take 
up space, resources, 
or require restart) 
App 
Δ 
Bins 
/ 
App 
A 
Bins 
/ 
Libs 
App 
A’ 
Bins 
/ 
Libs 
Gues 
t 
OS 
Modified App 
Copy on write 
capabilities allow us to 
only save the diffs 
between container A 
and container A’ 
VMs 
App 
A 
Bins 
/ 
Libs 
Guest 
OS 
Every app, every copy of an 
app, and every slight modification 
of the app requires a new virtual server 
App 
A 
Copy of 
App 
No OS. Can 
Share bins/libs 
Guest 
OS 
Guest 
OS
Containers, images, …
Terminology 
Docker concept OOP analogy 
Dockerfile Source code 
Image Class 
Container Instance
What are the basics of the Docker system? 
Dockerfile 
For 
A 
Source 
Code 
Repositor 
y 
Docker Engine 
Docker 
Container 
Image 
Registry 
Build 
Docker 
Host 2 OS (Linux) 
Container A 
Container B 
Container C 
Container A 
Push 
Search 
Pull 
Run 
Host 1 OS 
(Linux)
Changes and Updates 
App 
A’’ 
Bins 
/ 
Libs 
Docker Engine 
Docker 
Container 
Image 
Registry 
Push 
Update 
Docker Engine 
App 
A 
Bins 
/ 
Libs 
App 
Δ 
Bins 
/ 
Base 
Container 
Image 
Host is now running 
A’’ 
Container 
Mod A’’ 
App 
Δ 
Bins 
/ 
App 
A 
Bins 
/ 
Libs 
Bins 
/ 
Host running A wants to upgrade to A’’. 
Requests update. Gets only diffs 
Container 
Mod A’
A new open source project… or the next big thing? 
• Compatible with Jenkins, Travis, Chef, Puppet, Vagrant and OpenStack… 
• Ecosystem: lots of tools, even by serious contributors (Google – 
Kubernetes, cAdvisor - NetFlix …), new IAAS provider emerge (like 
Tutum), 
• Supported by Amazon, Google, Microsoft, Rackspace, Digital Ocean, 
Joyent, RedHat, … 
• Momentum... See pull requests numbers and frequency to get an idea 
• Used in production… even by big players (HP, Ebay, New Relic, Etsy, 
Yelp, Spotify, …)
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 
+) 
– CoreOS—Small 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 
• 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 
– 1000’s of Dockerized applications available at index.docker.io
Use Cases 
• Ted Dziuba on the Use of Docker for Continuous Integration at Ebay Now 
– https://speakerdeck.com/teddziuba/docker-at-ebay 
– http://www.youtube.com/watch?feature=player_embedded&v=0Hi0W4gX--4 
• Sasha Klizhentas on use of Docker at Mailgun/Rackspace 
• http://www.youtube.com/watch?feature=player_embedded&v=CMC3xdAo9RI 
• Sebastien Pahl on use of Docker at CloudFlare 
• http://www.youtube.com/watch?feature=player_embedded&v=-Lj3jt_-3r0 
• Cambridge HealthCare 
• http://blog.howareyou.com/post/62157486858/continuous-delivery-with-docker-and- 
jenkins-part-i 
• Red Hat Openshift and Docker 
• https://www.openshift.com/blogs/technical-thoughts-on-openshift-and-docker
Use Cases—From the Community 
Use Case Examples Link 
Clusters Building a MongoDB cluster using docker http://bit.ly/1acbjZf 
Production Quality MongoDB Setup with Docker http://bit.ly/15CaiHb 
Wildfly cluster using Docker on Fedora http://bit.ly/1bClX0O 
Build your own PaaS OpenSource PaaS built on Docker, Chef, and Heroku Buildpacks http://deis.io 
Web Based 
JiffyLab – web based environment for the instruction, or lightweight use of, 
Environment for 
Python and UNIX shell 
Instruction 
http://bit.ly/12oaj2K 
Easy Application 
Deployment 
Deploy Java Apps With Docker = Awesome http://bit.ly/11BCvvu 
How to put your development environment on docker http://bit.ly/1b4XtJ3 
Running Drupal on Docker http://bit.ly/15MJS6B 
Installing Redis on Docker http://bit.ly/16EWOKh 
Create Secure 
Sandboxes 
Docker makes creating secure sandboxes easier than ever http://bit.ly/13mZGJH 
Create your own SaaS Memcached as a Service http://bit.ly/11nL8vh 
Automated Application 
Deployment 
Multi-cloud Deployment with Docker http://bit.ly/1bF3CN6 
Continuous Integration 
and Deployment 
Next Generation Continuous Integration & Deployment with dotCloud’s 
Docker and Strider 
http://bit.ly/ZwTfoy 
Testing Salt States Rapidly With Docker http://bit.ly/1eFBtcm 
Lightweight Desktop 
Virtualization 
Docker Desktop: Your Desktop Over SSH Running Inside Of A Docker 
Container 
http://bit.ly/14RYL6x
How to build an image? 
Two ways to create an image: 
• You work in a container, then commit it for exploratory work 
• You build a new image from a Dockerfile for automated, 
repeatable process
1 container ?= (1process|1task|other) ? 
Best practices appear 
• Do not force you to 1 process per container 
• Ideal case: 1 ‘task’ per container, with separation of 
concerns. 
• The task might require 1 single process 
• Or 0 (for data-only containers) 
• Or several (ex: nginx+php-fpm, monitoring, …)
Containers are isolated… 
then how to make them talk to each other? 
• Private network between containers 
• Linking to make them easy to talk to a friend container 
• Expose ports 
• Mount volumes (rw or ro) 
• Advanced/not so trivial other solutions 
–Service discovery 
–Enter into the container’s namespace
How to handle data persistence 
• Data only containers, sharing data volumes 
• Mounting this data volumes in the running containers
How to handle data persistence 
How data volume works
How to handle data persistence 
How data volume works
Demo time! 
• Quick look at the Docker commands 
• Isolation demo 
• Multi containers demo: installing and launching Go Math! 
Academy in seconds. 
• Running unit tests in a container
The challenge of application distribution - Introduction to Docker (2014 dec 03)
Warning 
•Docker is great 
–It reduces dependencies, provides isolated and 
controlled context 
•But it brings new tools, and new technologies, hence 
a potential complexity increase 
–libswarm, systemd, etcd, ambassadord, fleet, etc
Some references 
• Start by the online tutorial and documentation, they are 
great! 
• Here’s some links kept while learning… but so much 
available! 
–Eight Docker Development Patterns 
–Panamax and Docker and Some Best Practices 
–Tutum blog 
–The 5 Most Important Things I’ve Learned From Using 
Docker 
–Understanding Docker Volumes 
–Docker's Youtube videos
More references 
First steps 
• dotScale 2013 - Solomon Hykes - Why we built Docker (video) 
• Twitter University – Solomon Hykes – Introduction to Docker (video) 
Going further 
• Docker layers cost (blog), on how to optimize your images layer size. 
• Twitter University - Docker at Spotify (video) 
• Top 10 open-source Docker developer tools (blog, incomplete but gives ideas) 
• Docker In-depth: Volumes (blog) 
Food for thought / Stimulate your imagination 
• AWS re:Invent 2014 - Lightning fast deploys with Docker containers and AWS (video, 
slides) 
• FutureStack14 - Docker and the Future of Modern Software (New Relic blog, video) 
• AWS re:Invent 2014 - Infrastructure as Code (video, more related to Cloudformation 
than to Docker but very inspiring if you consider the two technologies) 
• Alternative? Rocket by CoreOS… started a debate (like Joyent answer)
Tools for dev, day-to-day 
• For everyone 
• On Mac 
– Kitematic UI to manage your images/containers 
• On Windows 
– Try the new XShell5 beta to easily deal with all your current containers 
• So many others… and new ones every week 
• Fig (Fast isolated environments, by Docker) repo, site 
• A Better Development Environment with Docker and Fig (blog) 
• Lots of tools to manage multi containers apps: Kubernetes, Shipyard, 
Panamax,
Thank you
1 von 43

Recomendados

First steps to docker von
First steps to dockerFirst steps to docker
First steps to dockerGuilhem Marty
1.6K views18 Folien
What is Docker von
What is DockerWhat is Docker
What is DockerPavel Klimiankou
2.6K views24 Folien
Introduction to docker von
Introduction to dockerIntroduction to docker
Introduction to dockerWei-Ting Kuo
2.4K views43 Folien
Azure container service docker-ha noi com von
Azure container service   docker-ha noi comAzure container service   docker-ha noi com
Azure container service docker-ha noi comVan Phuc
250 views13 Folien
From development environments to production deployments with Docker, Compose,... von
From development environments to production deployments with Docker, Compose,...From development environments to production deployments with Docker, Compose,...
From development environments to production deployments with Docker, Compose,...Jérôme Petazzoni
33K views122 Folien
Docker Introduction von
Docker IntroductionDocker Introduction
Docker IntroductionMANAOUIL Karim
329 views15 Folien

Más contenido relacionado

Was ist angesagt?

Developer workflow with docker von
Developer workflow with dockerDeveloper workflow with docker
Developer workflow with dockerLalatendu Mohanty
1.1K views21 Folien
Learn docker in 90 minutes von
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
22.8K views20 Folien
Architecting .NET Applications for Docker and Container Based Deployments von
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based DeploymentsBen Hall
14.4K views101 Folien
Docker Introduction von
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
1.1K views12 Folien
Docker introduction von
Docker introductionDocker introduction
Docker introductionLayne Peng
1.3K views33 Folien
Visualising Basic Concepts of Docker von
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker vishnu rao
1.1K views43 Folien

Was ist angesagt?(20)

Learn docker in 90 minutes von Larry Cai
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
Larry Cai22.8K views
Architecting .NET Applications for Docker and Container Based Deployments von Ben Hall
Architecting .NET Applications for Docker and Container Based DeploymentsArchitecting .NET Applications for Docker and Container Based Deployments
Architecting .NET Applications for Docker and Container Based Deployments
Ben Hall14.4K views
Docker Introduction von Sparkbit
Docker IntroductionDocker Introduction
Docker Introduction
Sparkbit1.1K views
Docker introduction von Layne Peng
Docker introductionDocker introduction
Docker introduction
Layne Peng1.3K views
Visualising Basic Concepts of Docker von vishnu rao
Visualising Basic Concepts of Docker Visualising Basic Concepts of Docker
Visualising Basic Concepts of Docker
vishnu rao1.1K views
Docker presentation | Paris Docker Meetup von dotCloud
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud11.3K views
Intro to containerization von Balint Pato
Intro to containerizationIntro to containerization
Intro to containerization
Balint Pato1.9K views
Docker 101 @KACST Saudi HPC 2016 von Walid Shaari
Docker 101  @KACST Saudi HPC 2016Docker 101  @KACST Saudi HPC 2016
Docker 101 @KACST Saudi HPC 2016
Walid Shaari5.2K views
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire von dotCloud
Introduction to Docker at SF Peninsula Software Development Meetup @GuidewireIntroduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud3.1K views
Docker 101: An Introduction von POSSCON
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
POSSCON930 views
Docker-Hanoi @DKT , Presentation about Docker Ecosystem von Van Phuc
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc864 views
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12 von dotCloud
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
dotCloud4.9K views
Docker from A to Z, including Swarm and OCCS von Frank Munz
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
Frank Munz1.5K views
Ruby and Docker on Rails von Muriel Salvan
Ruby and Docker on RailsRuby and Docker on Rails
Ruby and Docker on Rails
Muriel Salvan6.3K views
Docker - 15 great Tutorials von Julien Barbier
Docker - 15 great TutorialsDocker - 15 great Tutorials
Docker - 15 great Tutorials
Julien Barbier7.8K views

Destacado

Docker Tours Meetup #1 - Introduction à Docker von
Docker Tours Meetup #1 - Introduction à DockerDocker Tours Meetup #1 - Introduction à Docker
Docker Tours Meetup #1 - Introduction à DockerThibaut Marmin
3.5K views41 Folien
Dev opsday case study von
Dev opsday   case studyDev opsday   case study
Dev opsday case studyRadoine Douhou
1.5K views39 Folien
French Webinar: XL Deploy 4.0 von
French Webinar: XL Deploy 4.0French Webinar: XL Deploy 4.0
French Webinar: XL Deploy 4.0XebiaLabs
2.5K views31 Folien
Déploiements avec Docker von
Déploiements avec DockerDéploiements avec Docker
Déploiements avec DockerLuis Lopez
3.1K views11 Folien
DOCKER AVEC RANCHER von
DOCKER AVEC RANCHERDOCKER AVEC RANCHER
DOCKER AVEC RANCHERTREEPTIK
515 views36 Folien
Deploiement continu AgileFfrance 2011 von
Deploiement continu AgileFfrance 2011Deploiement continu AgileFfrance 2011
Deploiement continu AgileFfrance 2011Claude Falguiere
1.2K views43 Folien

Destacado(20)

Docker Tours Meetup #1 - Introduction à Docker von Thibaut Marmin
Docker Tours Meetup #1 - Introduction à DockerDocker Tours Meetup #1 - Introduction à Docker
Docker Tours Meetup #1 - Introduction à Docker
Thibaut Marmin3.5K views
French Webinar: XL Deploy 4.0 von XebiaLabs
French Webinar: XL Deploy 4.0French Webinar: XL Deploy 4.0
French Webinar: XL Deploy 4.0
XebiaLabs2.5K views
Déploiements avec Docker von Luis Lopez
Déploiements avec DockerDéploiements avec Docker
Déploiements avec Docker
Luis Lopez3.1K views
DOCKER AVEC RANCHER von TREEPTIK
DOCKER AVEC RANCHERDOCKER AVEC RANCHER
DOCKER AVEC RANCHER
TREEPTIK515 views
Deploiement continu AgileFfrance 2011 von Claude Falguiere
Deploiement continu AgileFfrance 2011Deploiement continu AgileFfrance 2011
Deploiement continu AgileFfrance 2011
Claude Falguiere1.2K views
Symfony Live Paris 2016 - Ce que nous avons retenu von Sooyoos
Symfony Live Paris 2016 - Ce que nous avons retenuSymfony Live Paris 2016 - Ce que nous avons retenu
Symfony Live Paris 2016 - Ce que nous avons retenu
Sooyoos1.8K views
Presentation du framework symfony von Jeremy Gachet
Presentation du framework symfonyPresentation du framework symfony
Presentation du framework symfony
Jeremy Gachet11.9K views
2 Linux Container and Docker von Fabio Fumarola
2 Linux Container and Docker2 Linux Container and Docker
2 Linux Container and Docker
Fabio Fumarola8.1K views
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015 von Stephane Manciot
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015
Packaging et déploiement d'une application avec Docker et Ansible @DevoxxFR 2015
Stephane Manciot14.3K views
Orchestrez vos projets Symfony sans fausses notes von Xavier Gorse
Orchestrez vos projets Symfony sans fausses notesOrchestrez vos projets Symfony sans fausses notes
Orchestrez vos projets Symfony sans fausses notes
Xavier Gorse1K views
DevOps : mission [im]possible ? von rfelden
DevOps : mission [im]possible ?DevOps : mission [im]possible ?
DevOps : mission [im]possible ?
rfelden4.3K views
Docker introduction von dotCloud
Docker introductionDocker introduction
Docker introduction
dotCloud455.8K views
Reglement prime adaptation logement von ahup1
Reglement prime adaptation logementReglement prime adaptation logement
Reglement prime adaptation logement
ahup1473 views
Vulcan entre légende et modernité - présentation von Marinela
Vulcan  entre légende et modernité - présentationVulcan  entre légende et modernité - présentation
Vulcan entre légende et modernité - présentation
Marinela 475 views

Similar a The challenge of application distribution - Introduction to Docker (2014 dec 03)

Intro Docker october 2013 von
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013dotCloud
6.7K views27 Folien
Introduction to Docker von
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
14K views45 Folien
Intro to Docker November 2013 von
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013Docker, Inc.
1.4K views29 Folien
Dockers and kubernetes von
Dockers and kubernetesDockers and kubernetes
Dockers and kubernetesDr Ganesh Iyer
3.1K views133 Folien
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013 von
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 2013dotCloud
6.7K views42 Folien
Demystifying Containerization Principles for Data Scientists von
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data ScientistsDr Ganesh Iyer
198 views92 Folien

Similar a The challenge of application distribution - Introduction to Docker (2014 dec 03) (20)

Intro Docker october 2013 von dotCloud
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud6.7K views
Intro to Docker November 2013 von Docker, Inc.
Intro to Docker November 2013Intro to Docker November 2013
Intro to Docker November 2013
Docker, Inc.1.4K views
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013 von dotCloud
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
dotCloud6.7K views
Demystifying Containerization Principles for Data Scientists von Dr Ganesh Iyer
Demystifying Containerization Principles for Data ScientistsDemystifying Containerization Principles for Data Scientists
Demystifying Containerization Principles for Data Scientists
Dr Ganesh Iyer198 views
Docker open stack boston von dotCloud
Docker open stack bostonDocker open stack boston
Docker open stack boston
dotCloud4.7K views
Are VM Passé? von dotCloud
Are VM Passé? Are VM Passé?
Are VM Passé?
dotCloud7.3K views
Getting Started with Docker - Nick Stinemates von Atlassian
Getting Started with Docker - Nick StinematesGetting Started with Docker - Nick Stinemates
Getting Started with Docker - Nick Stinemates
Atlassian2.7K views
Application Deployment on Openstack von Docker, Inc.
Application Deployment on OpenstackApplication Deployment on Openstack
Application Deployment on Openstack
Docker, Inc.4.8K views
Intro to Docker October 2013 von Docker, Inc.
Intro to Docker October 2013Intro to Docker October 2013
Intro to Docker October 2013
Docker, Inc.933 views
Docker - Portable Deployment von javaonfly
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly1.9K views
Docker intro von spiddy
Docker introDocker intro
Docker intro
spiddy1.2K views

Último

Keep von
KeepKeep
KeepGeniusee
75 views10 Folien
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports von
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsRa'Fat Al-Msie'deen
5 views49 Folien
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... von
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Marc Müller
37 views83 Folien
SAP FOR TYRE INDUSTRY.pdf von
SAP FOR TYRE INDUSTRY.pdfSAP FOR TYRE INDUSTRY.pdf
SAP FOR TYRE INDUSTRY.pdfVirendra Rai, PMP
24 views3 Folien
EV Charging App Case von
EV Charging App Case EV Charging App Case
EV Charging App Case iCoderz Solutions
5 views1 Folie
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... von
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Lisi Hocke
28 views124 Folien

Último(20)

BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports von Ra'Fat Al-Msie'deen
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug ReportsBushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
BushraDBR: An Automatic Approach to Retrieving Duplicate Bug Reports
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... von Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller37 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... von Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke28 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... von Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
AI and Ml presentation .pptx von FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8711 views
Copilot Prompting Toolkit_All Resources.pdf von Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana8 views
Fleet Management Software in India von Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated... von TomHalpin9
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
Dev-HRE-Ops - Addressing the _Last Mile DevOps Challenge_ in Highly Regulated...
TomHalpin95 views
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut... von Deltares
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
DSD-INT 2023 Machine learning in hydraulic engineering - Exploring unseen fut...
Deltares7 views
SUGCON ANZ Presentation V2.1 Final.pptx von Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor22 views
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ... von Donato Onofri
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Unmasking the Dark Art of Vectored Exception Handling: Bypassing XDR and EDR ...
Donato Onofri795 views
Software evolution understanding: Automatic extraction of software identifier... von Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
360 graden fabriek von info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info3349237 views
Dapr Unleashed: Accelerating Microservice Development von Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski10 views

The challenge of application distribution - Introduction to Docker (2014 dec 03)

  • 1. The challenge of application distribution Introduction to Docker
  • 2. Credits & references Intros slides borrowed from • dotCloud’s « Docker introduction » slideshow • AWS re:Invent 2014 session APP303, « Lighting Fast Deploys with Docker Containers and AWS »
  • 3. Agenda • The application distribution challenge • The current solutions • Introduction to Docker, Containers, and the Matrix from Hell • Why people care: Separation of Concerns • Technical Discussion • Ecosystem, momentum • How to build Docker images • How to make containers talk to each other, how to handle data persistence • Demo 1: isolation • Demo 2: real case - installing Go Math!, tail –f containers, unit tests
  • 5. The challenge: apps have fundamentally changed ~2000 2014 Long lived Development is iterative and constant Monolithic and built on a single stack Built from loosely coupled components Deployed to a single server Deployed to a multitude of servers
  • 7. The challenge: apps have fundamentally changed Static website User DB Redis + redis-sentinel Web frontend 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 Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs + phantomjs Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client Development VM QA server Public Cloud Disaster recovery Contributor’s laptop Production Servers Multiplicity of Stacks Multiplicity of hardware environments Production Cluster Customer Data Center Do services and apps interact appropriately? Can I migrate smoothly and quickly?
  • 8. The Matrix From Hell Static website Web frontend Background workers User DB Analytics DB Queue ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Dev VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor’s laptop Customer Servers
  • 10. Current solutions • ‘Configuration’ tools like Ansible, Chef, Puppet, … • VM tools : Vagrant • Container tools: Google’s LMCTFY
  • 11. Goods Multiplicity of transporting/storing Multipilicity of methods for Do I worry about how goods interact (e.g. coffee beans next to spices) Can I transport quickly and smoothly (e.g. from boat to train to truck) Cargo Transport Pre-1960
  • 12. Also a matrix from hell ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 13. Multiplicity of Goods Multiplicity of methods for transporting/storin g Do I worry about how goods interact (e.g. coffee beans next to spices) Can I transport quickly and smoothly (e.g. from boat to train to truck) 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.
  • 15. Static website User DB Web frontend Queue Analytics DB Dev VM QA server Public Cloud Contributor’s laptop Docker is a shipping container system for code Multiplicity of Stacks Multiplicity of hardware environments Production Cluster Customer Data Center Do services and apps interact appropriately? Can I migrate smoothly and quickly …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…
  • 16. Static website Web frontend Background workers User DB Analytics DB Queue Dev VM QA Server Single Prod Server Onsite Cluster Public Cloud Contributor’s laptop Customer Servers Docker eliminates the matrix from Hell
  • 17. Good for developers • 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 compatibility 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? That’s the power of Docker * Anywhere = any x86 server running a modern Linux kernel (3.2+ generally. 2.6.32+ for RHEL 6.5+, Fedora, & related)
  • 18. Good for (Dev)Ops • 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 improves the speed and reliability of continuous deployment and continuous integration systems • Because the containers are so lightweight, address significant performance, costs, deployment, and portability issues normally associated with VMs
  • 19. Why it works—separation of concerns • Dan the Developer – Worries about what’s “inside” the container • His code • His Libraries • His Package Manager • His Apps • His Data – All Linux servers look the same • 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
  • 20. Under the hood • To learn more about how it works, some background: –Linux namespaces • PID • IPTables • UTS (~hostname) • Mount • IPC (inter-process) –CGroups –LXC Containers
  • 21. Containers vs. VMs App A Bins / Libs Bins / Libs Bins / Libs Hypervisor (Type 2) Host OS Server Guest OS App A’ Gues t OS App B Gues t OS App A’ Docker Host OS Server App A Bins/Libs Bins/Libs App B App B’ App B’ App B’ VM Container Containers are isolated, but share OS and, where appropriate, bins/libraries Guest OS Guest OS …result is significantly faster deployment, much less overhead, easier migration, faster restart
  • 22. Why are Docker containers lightweight? VMs Containers App A Bins / Libs Original App (No OS to take up space, resources, or require restart) App Δ Bins / App A Bins / Libs App A’ Bins / Libs Gues t OS Modified App Copy on write capabilities allow us to only save the diffs between container A and container A’ VMs App A Bins / Libs Guest OS Every app, every copy of an app, and every slight modification of the app requires a new virtual server App A Copy of App No OS. Can Share bins/libs Guest OS Guest OS
  • 24. Terminology Docker concept OOP analogy Dockerfile Source code Image Class Container Instance
  • 25. What are the basics of the Docker system? Dockerfile For A Source Code Repositor y Docker Engine Docker Container Image Registry Build Docker Host 2 OS (Linux) Container A Container B Container C Container A Push Search Pull Run Host 1 OS (Linux)
  • 26. Changes and Updates App A’’ Bins / Libs Docker Engine Docker Container Image Registry Push Update Docker Engine App A Bins / Libs App Δ Bins / Base Container Image Host is now running A’’ Container Mod A’’ App Δ Bins / App A Bins / Libs Bins / Host running A wants to upgrade to A’’. Requests update. Gets only diffs Container Mod A’
  • 27. A new open source project… or the next big thing? • Compatible with Jenkins, Travis, Chef, Puppet, Vagrant and OpenStack… • Ecosystem: lots of tools, even by serious contributors (Google – Kubernetes, cAdvisor - NetFlix …), new IAAS provider emerge (like Tutum), • Supported by Amazon, Google, Microsoft, Rackspace, Digital Ocean, Joyent, RedHat, … • Momentum... See pull requests numbers and frequency to get an idea • Used in production… even by big players (HP, Ebay, New Relic, Etsy, Yelp, Spotify, …)
  • 28. 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 +) – CoreOS—Small 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 • 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 – 1000’s of Dockerized applications available at index.docker.io
  • 29. Use Cases • Ted Dziuba on the Use of Docker for Continuous Integration at Ebay Now – https://speakerdeck.com/teddziuba/docker-at-ebay – http://www.youtube.com/watch?feature=player_embedded&v=0Hi0W4gX--4 • Sasha Klizhentas on use of Docker at Mailgun/Rackspace • http://www.youtube.com/watch?feature=player_embedded&v=CMC3xdAo9RI • Sebastien Pahl on use of Docker at CloudFlare • http://www.youtube.com/watch?feature=player_embedded&v=-Lj3jt_-3r0 • Cambridge HealthCare • http://blog.howareyou.com/post/62157486858/continuous-delivery-with-docker-and- jenkins-part-i • Red Hat Openshift and Docker • https://www.openshift.com/blogs/technical-thoughts-on-openshift-and-docker
  • 30. Use Cases—From the Community Use Case Examples Link Clusters Building a MongoDB cluster using docker http://bit.ly/1acbjZf Production Quality MongoDB Setup with Docker http://bit.ly/15CaiHb Wildfly cluster using Docker on Fedora http://bit.ly/1bClX0O Build your own PaaS OpenSource PaaS built on Docker, Chef, and Heroku Buildpacks http://deis.io Web Based JiffyLab – web based environment for the instruction, or lightweight use of, Environment for Python and UNIX shell Instruction http://bit.ly/12oaj2K Easy Application Deployment Deploy Java Apps With Docker = Awesome http://bit.ly/11BCvvu How to put your development environment on docker http://bit.ly/1b4XtJ3 Running Drupal on Docker http://bit.ly/15MJS6B Installing Redis on Docker http://bit.ly/16EWOKh Create Secure Sandboxes Docker makes creating secure sandboxes easier than ever http://bit.ly/13mZGJH Create your own SaaS Memcached as a Service http://bit.ly/11nL8vh Automated Application Deployment Multi-cloud Deployment with Docker http://bit.ly/1bF3CN6 Continuous Integration and Deployment Next Generation Continuous Integration & Deployment with dotCloud’s Docker and Strider http://bit.ly/ZwTfoy Testing Salt States Rapidly With Docker http://bit.ly/1eFBtcm Lightweight Desktop Virtualization Docker Desktop: Your Desktop Over SSH Running Inside Of A Docker Container http://bit.ly/14RYL6x
  • 31. How to build an image? Two ways to create an image: • You work in a container, then commit it for exploratory work • You build a new image from a Dockerfile for automated, repeatable process
  • 32. 1 container ?= (1process|1task|other) ? Best practices appear • Do not force you to 1 process per container • Ideal case: 1 ‘task’ per container, with separation of concerns. • The task might require 1 single process • Or 0 (for data-only containers) • Or several (ex: nginx+php-fpm, monitoring, …)
  • 33. Containers are isolated… then how to make them talk to each other? • Private network between containers • Linking to make them easy to talk to a friend container • Expose ports • Mount volumes (rw or ro) • Advanced/not so trivial other solutions –Service discovery –Enter into the container’s namespace
  • 34. How to handle data persistence • Data only containers, sharing data volumes • Mounting this data volumes in the running containers
  • 35. How to handle data persistence How data volume works
  • 36. How to handle data persistence How data volume works
  • 37. Demo time! • Quick look at the Docker commands • Isolation demo • Multi containers demo: installing and launching Go Math! Academy in seconds. • Running unit tests in a container
  • 39. Warning •Docker is great –It reduces dependencies, provides isolated and controlled context •But it brings new tools, and new technologies, hence a potential complexity increase –libswarm, systemd, etcd, ambassadord, fleet, etc
  • 40. Some references • Start by the online tutorial and documentation, they are great! • Here’s some links kept while learning… but so much available! –Eight Docker Development Patterns –Panamax and Docker and Some Best Practices –Tutum blog –The 5 Most Important Things I’ve Learned From Using Docker –Understanding Docker Volumes –Docker's Youtube videos
  • 41. More references First steps • dotScale 2013 - Solomon Hykes - Why we built Docker (video) • Twitter University – Solomon Hykes – Introduction to Docker (video) Going further • Docker layers cost (blog), on how to optimize your images layer size. • Twitter University - Docker at Spotify (video) • Top 10 open-source Docker developer tools (blog, incomplete but gives ideas) • Docker In-depth: Volumes (blog) Food for thought / Stimulate your imagination • AWS re:Invent 2014 - Lightning fast deploys with Docker containers and AWS (video, slides) • FutureStack14 - Docker and the Future of Modern Software (New Relic blog, video) • AWS re:Invent 2014 - Infrastructure as Code (video, more related to Cloudformation than to Docker but very inspiring if you consider the two technologies) • Alternative? Rocket by CoreOS… started a debate (like Joyent answer)
  • 42. Tools for dev, day-to-day • For everyone • On Mac – Kitematic UI to manage your images/containers • On Windows – Try the new XShell5 beta to easily deal with all your current containers • So many others… and new ones every week • Fig (Fast isolated environments, by Docker) repo, site • A Better Development Environment with Docker and Fig (blog) • Lots of tools to manage multi containers apps: Kubernetes, Shipyard, Panamax,

Hinweis der Redaktion

  1. Placeholder for demos, has I always click next! Switch to shell now