SlideShare une entreprise Scribd logo
1  sur  52
Télécharger pour lire hors ligne
a
Gentle Introduction
to
Docker
and
All Things Containers
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Devs
● all languages
● all databases
● all O/S
● targetting Linux systems
Docker will eventually be able to target FreeBSD, Solaris, and maybe OS X.
Ops
● any distro¹
● any cloud²
● any machine (physical, virtual...)
● recent kernels³
¹ as long as it's Ubuntu or Debian ☺ others coming soon
² as long as they don't ship with their custom crappy kernel
³ at least 3.8; support for RHEL 2.6.32 on the way
CFO, CIO, CTO, ...
● LESS overhead!
● MOAR consolidation!
● MOAR agility!
● LESS costs!
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
The Matrix From Hell
django
web
frontend
? ? ? ? ? ?
node.js
async API ? ? ? ? ? ?
background
workers ? ? ? ? ? ?
SQL
database
? ? ? ? ? ?
distributed
DB, big data ? ? ? ? ? ?
message
queue ? ? ? ? ? ?
my
laptop
your
laptop
QA staging prod on
cloud
VM
prod on bare
metal
Another Matrix from Hell
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Solution:
the intermodal shipping container
Solved!
Solution to the deployment problem:
the Linux container
Linux containers...
Units of software delivery (ship it!)
● run everywhere
– regardless of kernel version
– regardless of host distro
– (but container and host architecture must match*)
● 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
*Unless you emulate CPU with qemu and binfmt
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
High level approach:
it's a lightweight VM
● own process space
● own network interface
● can run stuff as root
● can have its own /sbin/init
(different from the host)
« Machine Container »
Low level approach:
it's chroot on steroids
● can also not have its own /sbin/init
● container = isolated process(es)
● share kernel with host
● no device emulation (neither HVM nor PV)
« Application Container »
Separation of concerns:
Dave the Developer
● inside my container:
– my code
– my libraries
– my package manager
– my app
– my data
Separation of concerns:
Oscar the Ops guy
● outside the container:
– logging
– remote access
– network configuration
– monitoring
How does it work?
Isolation with namespaces
● pid
● mnt
● net
● uts
● ipc
● user
How does it work?
Isolation with cgroups
● memory
● cpu
● blkio
● devices
If you're serious about security,
you also need…
● capabilities
– okay: cap_ipc_lock, cap_lease, cap_mknod,
cap_net_admin, cap_net_bind_service, cap_net_raw
– troublesome: cap_sys_admin (mount!)
● think twice before granting root
● grsec is nice
● seccomp (very specific use cases); seccomp-bpf
● beware of full-scale kernel exploits!
How does it work?
Copy-on-write storage
● unioning filesystems
(AUFS, overlayfs)
● snapshotting filesystems
(BTRFS, ZFS)
● copy-on-write block devices
(thin snapshots with LVM or device-mapper)
This is now being integrated with low-level LXC tools as well!
Efficiency
Compute efficiency:
almost no overhead
● processes are isolated,
but run straight on the host
● CPU performance
= native performance
● memory performance
= a few % shaved off for (optional) accounting
● network performance
= small overhead; can be reduced to zero
Storage efficiency:
many options!
Union
Filesystems
Snapshotting
Filesystems
Copy-on-write
block devices
Provisioning Superfast
Supercheap
Fast
Cheap
Fast
Cheap
Changing
small files
Superfast
Supercheap
Fast
Cheap
Fast
Costly
Changing
large files
Slow (first time)
Inefficient (copy-up!)
Fast
Cheap
Fast
Cheap
Diffing Superfast Superfast (ZFS)
Kinda meh (BTRFS)
Slow
Memory usage Efficient Efficient Inefficient
(at high densities)
Drawbacks Random quirks
AUFS not mainline
!AUFS more quirks
ZFS not mainline
BTRFS not as nice
Higher disk usage
Great performance
(except diffing)
Bottom line Ideal for PAAS and
high density things
This might be the
Future
Dodge Ram 3500
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Docker-what?
● Open Source engine to commoditize LXC
● using copy-on-write for quick provisioning
STOP!
HAMMER DEMO TIME.
Yes, but...
● « I don't need Docker;
I can do all that stuff with LXC tools, rsync,
some scripts! »
● correct on all accounts;
but it's also true for apt, dpkg, rpm, yum, etc.
● the whole point is to commoditize,
i.e. make it ridiculously easy to use
Containers before Docker
Containers after Docker
What this really means…
● instead of writing « very small shell scripts » to
manage containers, write them to do the rest:
– continuous deployment/integration/testing
– orchestration
● = use Docker as a building block
● re-use other people images (yay ecosystem!)
Docker-what?
The Big Picture
● Open Source engine to commoditize LXC
● using copy-on-write for quick provisioning
● allowing to create and share images
● standard format for containers
(stack of layers; 1 layer = tarball+metadata)
● standard, reproducible way to easily build
trusted images (Dockerfile, Stackbrew...)
Docker-what?
Under The Hood
● rewrite of dotCloud internal container engine
– original version: Python, tied to dotCloud's internal stuff
– released version: Go, legacy-free
● the Docker daemon runs in the background
– manages containers, images, and builds
– HTTP API (over UNIX or TCP socket)
– embedded CLI talking to the API
● Open Source (GitHub public repository + issue tracking)
● user and dev mailing lists
● FreeNode IRC channels #docker, #docker-dev
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Authoring images
with run/commit
1) docker run ubuntu bash
2) apt-get install this and that
3) docker commit <containerid> <imagename>
4) docker run <imagename> bash
5) git clone git://.../mycode
6) pip install -r requirements.txt
7) docker commit <containerid> <imagename>
8) repeat steps 4-7 as necessary
9) docker tag <imagename> <user/image>
10) docker push <user/image>
Authoring images
with a Dockerfile
FROM ubuntu
RUN apt-get -y update
RUN apt-get install -y g++
RUN apt-get install -y erlang-dev erlang-manpages erlang-base-hipe ...
RUN apt-get install -y libmozjs185-dev libicu-dev libtool ...
RUN apt-get install -y make wget
RUN wget http://.../apache-couchdb-1.3.1.tar.gz | tar -C /tmp -zxf-
RUN cd /tmp/apache-couchdb-* && ./configure && make install
RUN printf "[httpd]nport = 8101nbind_address = 0.0.0.0" >
/usr/local/etc/couchdb/local.d/docker.ini
EXPOSE 8101
CMD ["/usr/local/bin/couchdb"]
docker build -t jpetazzo/couchdb .
Authoring Images
with Trusted Builds
0) create a GitHub account
On index.docker.io:
1) create a Docker account
2) link it with your GitHub account
3) enable Trusted Builds on any public repo
On your dev env:
4) git add Dockerfile
5) git commit
6) git push
Authoring Images
with Chef/Puppet/Ansible/Salt/...
Plan A: « my other VM is a container »
● write a Dockerfile to install $YOUR_CM
● start tons of containers
● run $YOUR_CM in them
Good if you want a mix of containers/VM/metal
But slower to deploy, and uses more resources
Authoring Images
with Chef/Puppet/Ansible/Salt/...
Plan B: « the revolution will be containerized »
● write a Dockerfile to install $YOUR_CM
● … and run $YOUR_CM as part of build process
● deploy fully baked images
Faster to deploy
Easier to rollback
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Running containers
● SSH to Docker host and manual pull+run
● REST API (feel free to add SSL certs, OAUth...)
● OpenStack Nova
● OpenStack Heat
● who's next? OpenShift, CloudFoundry?
● multiple Open Source PAAS built on Docker
(Cocaine, Deis, Flynn...)
Orchestration & Service Discovery
(0.6.5)
● you can name your containers
● they get a generated name by default
(red_ant, gold_monkey...)
● you can link your containers
docker run -d -name frontdb
docker run -d -link frontdb:sql frontweb
→ container frontweb gets one bazillion environment vars
Orchestration & Service Discovery
roadmap
● currently single-host
● problem:
how do I link with containers on other hosts?
● solution:
ambassador pattern!
– app container runs in its happy place
– other things (Docker, containers...) plumb it
Orchestration roadmap
● currently static
● problem: what if I want to…
move a container?
do a master/slave failover?
WebScale my MangoDB cluster?
● solution:
dynamic discovery!
Multi-host Docker deployments
More on this
during my
lightning talk!
Outline
● Whom is this for?
● What's the problem?
● What's a Container?
● Docker 101
● Docker images
● Docker deployment
● Docker future
Docker: the community
● Docker: >200 contributors
● <7% of them work for dotCloud Docker inc.
● latest milestone (0.6): 40 contributors
● ~50% of all commits by external contributors
● GitHub repository: >800 forks
Docker: the ecosystem
● Cocaine (PAAS; has Docker plugin)
● CoreOS (full distro based on Docker)
● Deis (PAAS; available)
● Dokku (mini-Heroku in 100 lines of bash)
● Flynn (PAAS; in development)
● Maestro (orchestration from a simple YAML file)
● OpenStack integration (in Havana, Nova has a Docker driver)
● Pipework (high-performance, Software Defined Networks)
● Shipper (fabric-like orchestration)
And many more; including SAAS offerings (Orchard, Quay...)
Docker long-term roadmap
Docker 1.0:
● dynamic discovery
● remove AUFS, THINP, LXC, etc.
– execution? chroot!
– storage? cp!
– we can run everywhere o/
● re-add everything as plugins
Thank you! Questions?
http://docker.io/
http://docker.com/
https://github.com/dotcloud/docker
@docker
@jpetazzo

Contenu connexe

Tendances

Basic docker for developer
Basic docker for developerBasic docker for developer
Basic docker for developerWeerayut Hongsa
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux ContainerBalaji Rajan
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionPeng Xiao
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and DockerRob Loach
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelinesDevOps.com
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAlan Forbes
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerInstruqt
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpDocker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpJérôme Petazzoni
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to DockerJian Wu
 
Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Rama Krishna B
 
Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Jonas Rosland
 
Docker from A to Z, including Swarm and OCCS
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 OCCSFrank Munz
 

Tendances (20)

Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Basic docker for developer
Basic docker for developerBasic docker for developer
Basic docker for developer
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
Introduction to container based virtualization with docker
Introduction to container based virtualization with dockerIntroduction to container based virtualization with docker
Introduction to container based virtualization with docker
 
Introduction to Containers and Docker
Introduction to Containers and DockerIntroduction to Containers and Docker
Introduction to Containers and Docker
 
Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelines
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet UpDocker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
Docker
DockerDocker
Docker
 
Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)Docker and containers : Disrupting the virtual machine(VM)
Docker and containers : Disrupting the virtual machine(VM)
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015Docker and containers - For Boston Docker Meetup Workshop in March 2015
Docker and containers - For Boston Docker Meetup Workshop in March 2015
 
Docker from A to Z, including Swarm and OCCS
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
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 

En vedette

DockerCon SF 2015: Education for a digital world
DockerCon SF 2015: Education for a digital worldDockerCon SF 2015: Education for a digital world
DockerCon SF 2015: Education for a digital worldDocker, Inc.
 
Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Docker, Inc.
 
Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Docker, Inc.
 
Experiences with AWS immutable deploys and job processing
Experiences with AWS immutable deploys and job processingExperiences with AWS immutable deploys and job processing
Experiences with AWS immutable deploys and job processingDocker, Inc.
 
DockerCon14 Keynote
DockerCon14 KeynoteDockerCon14 Keynote
DockerCon14 KeynoteDocker, Inc.
 
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaSDockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaSDocker, Inc.
 
Building a Platform with Django, Docker and Salt
Building a Platform with Django, Docker and SaltBuilding a Platform with Django, Docker and Salt
Building a Platform with Django, Docker and SaltDocker, Inc.
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQDocker, Inc.
 
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDocker, Inc.
 
DockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to MinutesDockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to MinutesDocker, Inc.
 
DockerCon EU 2015: Compute as an Interruption Forget the Servers
DockerCon EU 2015: Compute as an Interruption Forget the ServersDockerCon EU 2015: Compute as an Interruption Forget the Servers
DockerCon EU 2015: Compute as an Interruption Forget the ServersDocker, Inc.
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker, Inc.
 
Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Docker, Inc.
 
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...Docker, Inc.
 
Building Images from dockerfiles
Building Images from dockerfilesBuilding Images from dockerfiles
Building Images from dockerfilesDocker, Inc.
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressDocker, Inc.
 
DockerCon 16 - Moby's Cool Hack Session
DockerCon 16 - Moby's Cool Hack SessionDockerCon 16 - Moby's Cool Hack Session
DockerCon 16 - Moby's Cool Hack SessionDocker, Inc.
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Docker, Inc.
 
Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Docker, Inc.
 

En vedette (20)

DockerCon SF 2015: Education for a digital world
DockerCon SF 2015: Education for a digital worldDockerCon SF 2015: Education for a digital world
DockerCon SF 2015: Education for a digital world
 
Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1Dockerfile Basics Workshop #1
Dockerfile Basics Workshop #1
 
Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta Mobycraft - Docker in 8-bit by Aditya Gupta
Mobycraft - Docker in 8-bit by Aditya Gupta
 
Experiences with AWS immutable deploys and job processing
Experiences with AWS immutable deploys and job processingExperiences with AWS immutable deploys and job processing
Experiences with AWS immutable deploys and job processing
 
DockerCon14 Keynote
DockerCon14 KeynoteDockerCon14 Keynote
DockerCon14 Keynote
 
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaSDockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
DockerCon EU 2015: The Glue is the Hard Part: Making a Production-Ready PaaS
 
Building a Platform with Django, Docker and Salt
Building a Platform with Django, Docker and SaltBuilding a Platform with Django, Docker and Salt
Building a Platform with Django, Docker and Salt
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQ
 
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker EnvironmentsDockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
DockerCon EU 2015: Monitoring and Managing Dynamic Docker Environments
 
DockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to MinutesDockerCon SF 2015: From Months to Minutes
DockerCon SF 2015: From Months to Minutes
 
DockerCon EU 2015: Compute as an Interruption Forget the Servers
DockerCon EU 2015: Compute as an Interruption Forget the ServersDockerCon EU 2015: Compute as an Interruption Forget the Servers
DockerCon EU 2015: Compute as an Interruption Forget the Servers
 
Docker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF MeetupDocker 1.11 @ Docker SF Meetup
Docker 1.11 @ Docker SF Meetup
 
Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...Making it Easier to Contribute to Open Source Projects Using Docker Container...
Making it Easier to Contribute to Open Source Projects Using Docker Container...
 
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
The Mushroom Cloud Effect or What Happens When Containers Fail? by Alois Mayr...
 
Building Images from dockerfiles
Building Images from dockerfilesBuilding Images from dockerfiles
Building Images from dockerfiles
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 
DockerCon 16 - Moby's Cool Hack Session
DockerCon 16 - Moby's Cool Hack SessionDockerCon 16 - Moby's Cool Hack Session
DockerCon 16 - Moby's Cool Hack Session
 
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
Autoscaling Docker Containers by Konstantinos Faliagkas, Docker Birthday #3 A...
 
Developer Week
Developer WeekDeveloper Week
Developer Week
 
Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2
 

Similaire à A Gentle Introduction to Docker and Containers

Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and ContainersDocker, Inc.
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQdotCloud
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersJérôme Petazzoni
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesJérôme Petazzoni
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
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 @GuidewiredotCloud
 
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionJérôme Petazzoni
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniTheFamily
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionJérôme Petazzoni
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xrkr10
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkJérôme Petazzoni
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Jérôme Petazzoni
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013dotCloud
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Docker, Inc.
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyJérôme Petazzoni
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013dotCloud
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryDocker, Inc.
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Jérôme Petazzoni
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet
 

Similaire à A Gentle Introduction to Docker and Containers (20)

Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQIntroduction to Docker and all things containers, Docker Meetup at RelateIQ
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
 
A Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things ContainersA Gentle Introduction To Docker And All Things Containers
A Gentle Introduction To Docker And All Things Containers
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los AngelesDocker 0.11 at MaxCDN meetup in Los Angeles
Docker 0.11 at MaxCDN meetup in Los Angeles
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
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
 
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special EditionIntroduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Docker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12xDocker and-containers-for-development-and-deployment-scale12x
Docker and-containers-for-development-and-deployment-scale12x
 
Introduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New YorkIntroduction to Docker at the Azure Meet-up in New York
Introduction to Docker at the Azure Meet-up in New York
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
 
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013Lightweight Virtualization with Linux Containers and Docker | YaC 2013
Lightweight Virtualization with Linux Containers and Docker | YaC 2013
 
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013Lightweight Virtualization with Linux Containers and Docker I YaC 2013
Lightweight Virtualization with Linux Containers and Docker I YaC 2013
 
JOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to dockerJOSA TechTalk: Introduction to docker
JOSA TechTalk: Introduction to docker
 
Introduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange CountyIntroduction to Docker at Glidewell Laboratories in Orange County
Introduction to Docker at Glidewell Laboratories in Orange County
 
LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013LXC, Docker, and the future of software delivery | LinuxCon 2013
LXC, Docker, and the future of software delivery | LinuxCon 2013
 
LXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software DeliveryLXC Docker and the Future of Software Delivery
LXC Docker and the Future of Software Delivery
 
Let's Containerize New York with Docker!
Let's Containerize New York with Docker!Let's Containerize New York with Docker!
Let's Containerize New York with Docker!
 
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3 Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
Puppet Camp Seattle 2014: Docker and Puppet: 1+1=3
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 

Plus de Docker, Inc.

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Docker, Inc.
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXDocker, Inc.
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDocker, Inc.
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices WorldDocker, Inc.
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...Docker, Inc.
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with DockerDocker, Inc.
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeDocker, Inc.
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryDocker, Inc.
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Docker, Inc.
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels Docker, Inc.
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...Docker, Inc.
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDocker, Inc.
 

Plus de Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 

A Gentle Introduction to Docker and Containers

  • 2. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 3. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 4. Devs ● all languages ● all databases ● all O/S ● targetting Linux systems Docker will eventually be able to target FreeBSD, Solaris, and maybe OS X.
  • 5. Ops ● any distro¹ ● any cloud² ● any machine (physical, virtual...) ● recent kernels³ ¹ as long as it's Ubuntu or Debian ☺ others coming soon ² as long as they don't ship with their custom crappy kernel ³ at least 3.8; support for RHEL 2.6.32 on the way
  • 6. CFO, CIO, CTO, ... ● LESS overhead! ● MOAR consolidation! ● MOAR agility! ● LESS costs!
  • 7. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 8. The Matrix From Hell django web frontend ? ? ? ? ? ? node.js async API ? ? ? ? ? ? background workers ? ? ? ? ? ? SQL database ? ? ? ? ? ? distributed DB, big data ? ? ? ? ? ? message queue ? ? ? ? ? ? my laptop your laptop QA staging prod on cloud VM prod on bare metal
  • 9. Another Matrix from Hell ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
  • 12. Solution to the deployment problem: the Linux container
  • 13. Linux containers... Units of software delivery (ship it!) ● run everywhere – regardless of kernel version – regardless of host distro – (but container and host architecture must match*) ● 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 *Unless you emulate CPU with qemu and binfmt
  • 14. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 15. High level approach: it's a lightweight VM ● own process space ● own network interface ● can run stuff as root ● can have its own /sbin/init (different from the host) « Machine Container »
  • 16. Low level approach: it's chroot on steroids ● can also not have its own /sbin/init ● container = isolated process(es) ● share kernel with host ● no device emulation (neither HVM nor PV) « Application Container »
  • 17. Separation of concerns: Dave the Developer ● inside my container: – my code – my libraries – my package manager – my app – my data
  • 18. Separation of concerns: Oscar the Ops guy ● outside the container: – logging – remote access – network configuration – monitoring
  • 19. How does it work? Isolation with namespaces ● pid ● mnt ● net ● uts ● ipc ● user
  • 20. How does it work? Isolation with cgroups ● memory ● cpu ● blkio ● devices
  • 21. If you're serious about security, you also need… ● capabilities – okay: cap_ipc_lock, cap_lease, cap_mknod, cap_net_admin, cap_net_bind_service, cap_net_raw – troublesome: cap_sys_admin (mount!) ● think twice before granting root ● grsec is nice ● seccomp (very specific use cases); seccomp-bpf ● beware of full-scale kernel exploits!
  • 22. How does it work? Copy-on-write storage ● unioning filesystems (AUFS, overlayfs) ● snapshotting filesystems (BTRFS, ZFS) ● copy-on-write block devices (thin snapshots with LVM or device-mapper) This is now being integrated with low-level LXC tools as well!
  • 24. Compute efficiency: almost no overhead ● processes are isolated, but run straight on the host ● CPU performance = native performance ● memory performance = a few % shaved off for (optional) accounting ● network performance = small overhead; can be reduced to zero
  • 25. Storage efficiency: many options! Union Filesystems Snapshotting Filesystems Copy-on-write block devices Provisioning Superfast Supercheap Fast Cheap Fast Cheap Changing small files Superfast Supercheap Fast Cheap Fast Costly Changing large files Slow (first time) Inefficient (copy-up!) Fast Cheap Fast Cheap Diffing Superfast Superfast (ZFS) Kinda meh (BTRFS) Slow Memory usage Efficient Efficient Inefficient (at high densities) Drawbacks Random quirks AUFS not mainline !AUFS more quirks ZFS not mainline BTRFS not as nice Higher disk usage Great performance (except diffing) Bottom line Ideal for PAAS and high density things This might be the Future Dodge Ram 3500
  • 26. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 27.
  • 28. Docker-what? ● Open Source engine to commoditize LXC ● using copy-on-write for quick provisioning STOP! HAMMER DEMO TIME.
  • 29.
  • 30. Yes, but... ● « I don't need Docker; I can do all that stuff with LXC tools, rsync, some scripts! » ● correct on all accounts; but it's also true for apt, dpkg, rpm, yum, etc. ● the whole point is to commoditize, i.e. make it ridiculously easy to use
  • 33. What this really means… ● instead of writing « very small shell scripts » to manage containers, write them to do the rest: – continuous deployment/integration/testing – orchestration ● = use Docker as a building block ● re-use other people images (yay ecosystem!)
  • 34. Docker-what? The Big Picture ● Open Source engine to commoditize LXC ● using copy-on-write for quick provisioning ● allowing to create and share images ● standard format for containers (stack of layers; 1 layer = tarball+metadata) ● standard, reproducible way to easily build trusted images (Dockerfile, Stackbrew...)
  • 35. Docker-what? Under The Hood ● rewrite of dotCloud internal container engine – original version: Python, tied to dotCloud's internal stuff – released version: Go, legacy-free ● the Docker daemon runs in the background – manages containers, images, and builds – HTTP API (over UNIX or TCP socket) – embedded CLI talking to the API ● Open Source (GitHub public repository + issue tracking) ● user and dev mailing lists ● FreeNode IRC channels #docker, #docker-dev
  • 36. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 37. Authoring images with run/commit 1) docker run ubuntu bash 2) apt-get install this and that 3) docker commit <containerid> <imagename> 4) docker run <imagename> bash 5) git clone git://.../mycode 6) pip install -r requirements.txt 7) docker commit <containerid> <imagename> 8) repeat steps 4-7 as necessary 9) docker tag <imagename> <user/image> 10) docker push <user/image>
  • 38. Authoring images with a Dockerfile FROM ubuntu RUN apt-get -y update RUN apt-get install -y g++ RUN apt-get install -y erlang-dev erlang-manpages erlang-base-hipe ... RUN apt-get install -y libmozjs185-dev libicu-dev libtool ... RUN apt-get install -y make wget RUN wget http://.../apache-couchdb-1.3.1.tar.gz | tar -C /tmp -zxf- RUN cd /tmp/apache-couchdb-* && ./configure && make install RUN printf "[httpd]nport = 8101nbind_address = 0.0.0.0" > /usr/local/etc/couchdb/local.d/docker.ini EXPOSE 8101 CMD ["/usr/local/bin/couchdb"] docker build -t jpetazzo/couchdb .
  • 39. Authoring Images with Trusted Builds 0) create a GitHub account On index.docker.io: 1) create a Docker account 2) link it with your GitHub account 3) enable Trusted Builds on any public repo On your dev env: 4) git add Dockerfile 5) git commit 6) git push
  • 40. Authoring Images with Chef/Puppet/Ansible/Salt/... Plan A: « my other VM is a container » ● write a Dockerfile to install $YOUR_CM ● start tons of containers ● run $YOUR_CM in them Good if you want a mix of containers/VM/metal But slower to deploy, and uses more resources
  • 41. Authoring Images with Chef/Puppet/Ansible/Salt/... Plan B: « the revolution will be containerized » ● write a Dockerfile to install $YOUR_CM ● … and run $YOUR_CM as part of build process ● deploy fully baked images Faster to deploy Easier to rollback
  • 42. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 43. Running containers ● SSH to Docker host and manual pull+run ● REST API (feel free to add SSL certs, OAUth...) ● OpenStack Nova ● OpenStack Heat ● who's next? OpenShift, CloudFoundry? ● multiple Open Source PAAS built on Docker (Cocaine, Deis, Flynn...)
  • 44. Orchestration & Service Discovery (0.6.5) ● you can name your containers ● they get a generated name by default (red_ant, gold_monkey...) ● you can link your containers docker run -d -name frontdb docker run -d -link frontdb:sql frontweb → container frontweb gets one bazillion environment vars
  • 45. Orchestration & Service Discovery roadmap ● currently single-host ● problem: how do I link with containers on other hosts? ● solution: ambassador pattern! – app container runs in its happy place – other things (Docker, containers...) plumb it
  • 46. Orchestration roadmap ● currently static ● problem: what if I want to… move a container? do a master/slave failover? WebScale my MangoDB cluster? ● solution: dynamic discovery!
  • 47. Multi-host Docker deployments More on this during my lightning talk!
  • 48. Outline ● Whom is this for? ● What's the problem? ● What's a Container? ● Docker 101 ● Docker images ● Docker deployment ● Docker future
  • 49. Docker: the community ● Docker: >200 contributors ● <7% of them work for dotCloud Docker inc. ● latest milestone (0.6): 40 contributors ● ~50% of all commits by external contributors ● GitHub repository: >800 forks
  • 50. Docker: the ecosystem ● Cocaine (PAAS; has Docker plugin) ● CoreOS (full distro based on Docker) ● Deis (PAAS; available) ● Dokku (mini-Heroku in 100 lines of bash) ● Flynn (PAAS; in development) ● Maestro (orchestration from a simple YAML file) ● OpenStack integration (in Havana, Nova has a Docker driver) ● Pipework (high-performance, Software Defined Networks) ● Shipper (fabric-like orchestration) And many more; including SAAS offerings (Orchard, Quay...)
  • 51. Docker long-term roadmap Docker 1.0: ● dynamic discovery ● remove AUFS, THINP, LXC, etc. – execution? chroot! – storage? cp! – we can run everywhere o/ ● re-add everything as plugins