SlideShare a Scribd company logo
Lean Containers
1 / 49
Who am I?
Jérôme Petazzoni (@jpetazzo)
French software engineer living in California
Joined Docker (dotCloud) more than 4 years ago
(I was at Docker before it was cool!)
I have built and scaled the dotCloud PaaS
I learned a few things about running containers
(in production)
2 / 49
Outline
Brief intro about Docker and containers
VMs and containers: technical differences
VMs and containers: functional differences
Lean containers
Composing stacks of containers
3 / 49
Brief intro
about Docker
and containers
4 / 49
Build, ship, and run
any app, anywhere
5 / 49
Take any Linux program, and put it in a container
Web apps and services, workers
(Go, Java, Node, PHP, Python, Ruby...)
Data stores: SQL, NoSQL, big data
(Cassandra, ElasticSearch, Hadoop, Mongo, MySQL, PostgreSQL, Redis...)
Other server-y things
(Consul, Etcd, Mesos, RabbitMQ, Zookeeper...)
Command-line tools
(AWS CLI, Ffmpeg...)
Desktop apps
(Chrome, LibreOffice, Skype, Steam...)
6 / 49
What about non-Linux programs?
Desktop apps with WINE
(e.g.: Spotify client)
Coming soon: Docker for Windows
(run Windows apps on Windows machines)
Coming soon: Docker for FreeBSD
(port in progress)
Coming eventually: Docker for OS X
(technically possible; but is this useful?)
7 / 49
Ship that container easily and efficiently
Docker comes with an image distribution protocol
Distribution server can be hosted by Docker Inc.
(free for public images)
Distribution protocol is public
Open source reference implementation
(used by Docker Inc. for the public registry)
Container images are broken down into layers
When updating and distributing an image,
only ship relevant layers
8 / 49
Run those containers anywhere
Containers can run in VMs or in physical machines
Docker is available on all modern Linux variants
Many IAAS providers have server images with Docker
On OS X and Windows dev machines: boot2docker
There are distros dedicated to run Docker containers
(Atomic, CoreOS, RancherOS, Snappy Core...)
Other Docker implementations exist (e.g. Joyent Triton)
9 / 49
VMs and
containers:
technical
differences
10 / 49
Containers are portable
VMs can't easily be moved
nested hypervisors (VMs in VMs) exist, but still rare
VM images have to be converted and transferred
(both are slow operations)
The same container can run on any machine
(physical or virtual)
Containers use a stable interface
Intel 64 bits machine code
Linux system calls ABI
11 / 49
Containers have low overhead
Normal* process(es) running on top of normal kernel
No device emulation (no extra code path involved in I/O)
Context switch between containers
= context switch between processes
Benchmarks show no difference at all
between containers and bare metal
(after adequate tuning and options have been selected)
Containers have higher density
* There are extra "labels" denoting membership to given
namespaces and control groups. Similar to regular UID.
12 / 49
VMs have stronger isolation
Inter-VM communication must happen over the network
(Some hypervisors have custom paths, but non-standard)
VMs can run as non-privileged processes on the host
(Breaking out of a VM will have ~zero security impact)
Containers run on top of a single kernel
(Kernel vulnerability can lead to full scale compromise)
Containers can share files, sockets, FIFOs, memory areas...
(They can communicate with standard UNIX mechanisms)
13 / 49
Analogy: brick walls vs. room dividers
Brick walls
sturdy
slow to build
messy to move
Room dividers
fragile
deployed in seconds
moved easily
14 / 49
Blurring lines
Intel Clear Containers; Clever Cloud
(stripped down VMs, boot super fast, tiny footprint)
Joyent Triton
(Solaris "branded zones," running Linux binaries securely,
exposing the Docker API)
Ongoing efforts to harden containers
(GRSEC, SELinux, AppArmor)
15 / 49
VMs and
containers:
functional
differences
16 / 49
Inside
VMs typically contains* everything they need
(Backups, logging, periodic job execution, remote access...)
Containers are the subject of an epic debate:
machine container
(runs init, cron, ssh, syslog ... and the app)
application container
(runs the app and nothing else;
relies on external mechanisms)
* No pun intended!
17 / 49
Creation / deployment
Containers are (typically) created from an image
Updates = update the image, redeploy a new container
"Immutable servers" pattern
VMs can use the same pattern ("golden images"),
but it's heavier to setup
VMs often have a long lifecycle instead
(provisioning→update→update→…→update→disposal)
easily leads to configuration drift
(subtle differences that add up over time)
requires tight configuration management
18 / 49
Development process (VMs)
Hypothesis: app broken down in 10 components
Production: 10+ VMs (each component in 1+ VM)
Development: typically 1 VM for whole app
Different components depending on environment
(e.g.: logging, monitoring, service discovery...)
Consequence: prod and dev deployments differ a lot
19 / 49
Development process (containers)
Hypothesis: app broken down in 10 components
Production: 10+ containers (across any number of VMs)
Development: 10 containers on 1 dev VM
Re-use the same container images for prod and dev
How do we provide container variants?
20 / 49
Bloated containers
Containers have all the software required for production
In dev mode, only essential processes are started
In prod mode, additional processes run as well
Problems:
bigger containers
behavior can differ (because of extra processes)
extra processes duplicated between containers
hard to test those extra processes in isolation
21 / 49
Lean containers
22 / 49
Principle
"Do one thing, do it well"
One container for the component itself
One container for logging
One container for monitoring
One container for backups
One container for debugging (when needed)
etc.
23 / 49
Implementation (general principles)
Containers can share almost anything, selectively
files
(logs, data at rest, audit)
network stack
(traffic routing and analysis, monitoring)
process space, memory
(process tracing and debugging)
24 / 49
Let's dive into the
details
25 / 49
Logging (option 1: Docker logging drivers)
Containers write to standard output
Docker has different logging drivers:
writes to local JSON files by default
can send to syslog
Imperfect solution for now, but will be improved.
Preferred in the long run.
26 / 49
Logging (option 2: shared log directory)
Containers write regular files to a directory
That directory is shared with another container
dockerrun-d--namemyapp1-v/var/logmyapp:v1.0
In development setup:
dockerrun--volumes-frommyapp1ubuntu
sh-c'tail-F/var/log/*'
In production:
dockerrun-d--volumes-frommyapp1logcollector
27 / 49
Logging takeaways
Application can be "dumb" about logging
Log collection and shipping happens in Docker,
or in separate(s) container(s)
Run custom log analyzer without changing app container
(e.g. apachetop)
Migrate logging system without changing app container
28 / 49
"Yes, but..."
"What about performance overhead?"
no performance overhead
both containers access files directly
(just like processes running on the same machine)
"What about synchronization issues?"
same as previous answer!
29 / 49
Backups (file-based)
Store mutable data on Docker volumes
(same mechanism as for logs)
Share volumes with special-purpose backup containers
Put backup tools in the backup container
(boto, rsync, s3cmd, unison...)
dockerrun--volumes-frommydb1ubuntu
rsync-av/var/lib/backup@remotehost:mydb1/
The whole setup doesn't touch the app (or DB) container
30 / 49
Backups (network-based)
Run the backup job (pg_dump, mysqldump, etc.)
from a separate container
Nothing complicated, but with VMs, this is overkill
("this VM does nothing at all; except a few minutes per day!")
Advantages (vs. running in the same container):
nothing to install in the app (or DB) container
if the backup job runs amok, it remains contained (!)
31 / 49
Network analysis
Packet capture (tcpdump, ngrep, ntop, etc.)
Low-level metrics (netstat, ss, etc.)
Install required tools in a separate container image
Run a container in the same network namespace
dockerrun-d--nameweb1nginx
dockerrun-ti--netcontainer:web1tcpdump-pnieth0
dockerrun-ti--netcontainer:web1ubuntuss-n--tcp
32 / 49
Service discovery
Docker can do linking and generic DNS injection
Your code connects to e.g. redis
(pretending that redisresolves to something)
Docker adds a DNS alias* so that redisresolves
to the right container, or to some external service
In dev, Docker Compose manages service dependencies
In prod, you abstract service discovery from the container
* Really, an entry in the container's /etc/hosts.
33 / 49
Service discovery in practice
When service A needs to talk to service B...
1. Start container B on a Docker host
34 / 49
Service discovery in practice
When service A needs to talk to service B...
1. Start container B on a Docker host
2. Retrieve host+port allocated for B
35 / 49
Service discovery in practice
When service A needs to talk to service B...
1. Start container B on a Docker host
2. Retrieve host+port allocated for B
3. Start ambassador (relaying to this host+port)
36 / 49
Service discovery in practice
When service A needs to talk to service B...
1. Start container B on a Docker host
2. Retrieve host+port allocated for B
3. Start ambassador (relaying to this host+port)
4. Start container A linked to ambassador
37 / 49
Service discovery in practice
When service A needs to talk to service B...
1. Start container B on a Docker host
2. Retrieve host+port allocated for B
3. Start ambassador (relaying to this host+port)
4. Start container A linked to ambassador
5. Profit!
38 / 49
General pattern
Your code runs in the same container in dev and prod
Add "sidekick*" containers for additional tasks
Developers don't have to be bothered about ops
Ops can do their job without messing with devs' code
* Kubernetes sometimes calls them "sidecars."
39 / 49
Composing
stacks of
containers
40 / 49
Docker Compose
41 / 49
docker-compose.yml
rng:
build:rng
hasher:
build:hasher
webui:
build:webui
links:
-redis
ports:
-"80:80"
volumes:
-"webui/files/:/files/"
redis:
image:redis
worker:
build:worker
links:
-rng
-hasher
-redis
42 / 49
Docker Compose
Start whole stack with docker-composeup
Start individual containers (and their dependencies)
with docker-composeupxyz
Takes care of container lifecycle
(creation, update, data persistence, scaling up/down...)
Doesn't automatically solve networking and discovery (yet)
43 / 49
Docker Compose
Start whole stack with docker-composeup
Start individual containers (and their dependencies)
with docker-composeupxyz
Takes care of container lifecycle
(creation, update, data persistence, scaling up/down...)
Doesn't automatically solve networking and discovery (yet)
... However ...
44 / 49
docker-compose.yml, reloaded
hasher:
build:hasher
worker:
build:worker
links:
-rng
-hasherproxy:hasher
-redis
hasherproxy:
image:jpetazzo/hamba
links:
-hasher
command:80hasher80
(This was automatically generated by a tiny Python script.)
45 / 49
Fair warning
Docker networking is evolving quickly
Docker 1.7 (to be released Real Soon Now) will support:
"networks" as first class objects
multiple networks
overlay driver allowing to span networks across
multiple hosts
networking plugins from ecosystem partners
46 / 49
Conclusions
47 / 49
Conclusions
Containers can share more context than VMs
We can use this to decouple complexity
(think "microservices" but for ops/devs separation)
All tasks typically requiring VM access
can be done in separate containers
As a result, deployments are broken down
in smaller, simpler pieces
Complex stacks are expressed with simple YAML files
Docker isn't a "silver bullet" to solve all problems,
but it gives us tools that make our jobs easier
48 / 49
Thanks!
Questions?
@jpetazzo
@docker
49 / 49

More Related Content

What's hot

Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Etsuji Nakai
 
Understanding LXC & Docker
Understanding LXC & DockerUnderstanding LXC & Docker
Understanding LXC & Docker
Comprinno Technologies
 
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Tobias Schneck
 
Docker vs kvm
Docker vs kvmDocker vs kvm
Docker vs kvm
Wilson Cunalata
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Jérôme Petazzoni
 
LXC
LXCLXC
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
Linuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best PracticesLinuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best Practices
christophm
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Phil Estes
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
Richard Lister
 
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
Jérôme Petazzoni
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
muayyad alsadi
 
Lxc- Introduction
Lxc- IntroductionLxc- Introduction
Lxc- Introduction
Luís Eduardo
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Jérôme Petazzoni
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
Sim Janghoon
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Union FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a ContainerUnion FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a Container
Knoldus Inc.
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
Boden Russell
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to Kubernetes
Shreyas MM
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?
Docker, Inc.
 

What's hot (20)

Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7Inside Docker for Fedora20/RHEL7
Inside Docker for Fedora20/RHEL7
 
Understanding LXC & Docker
Understanding LXC & DockerUnderstanding LXC & Docker
Understanding LXC & Docker
 
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
Skale your test environment! Containerized End-2-End-Testing @Herbstcampus Nü...
 
Docker vs kvm
Docker vs kvmDocker vs kvm
Docker vs kvm
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
 
LXC
LXCLXC
LXC
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
 
Linuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best PracticesLinuxcon Barcelon 2012: LXC Best Practices
Linuxcon Barcelon 2012: LXC Best Practices
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
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
 
Techtalks: taking docker to production
Techtalks: taking docker to productionTechtalks: taking docker to production
Techtalks: taking docker to production
 
Lxc- Introduction
Lxc- IntroductionLxc- Introduction
Lxc- Introduction
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxConAnatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
 
Docker - container and lightweight virtualization
Docker - container and lightweight virtualization Docker - container and lightweight virtualization
Docker - container and lightweight virtualization
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Union FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a ContainerUnion FileSystem - A Building Blocks Of a Container
Union FileSystem - A Building Blocks Of a Container
 
Lxc – next gen virtualization for cloud intro (cloudexpo)
Lxc – next gen virtualization for cloud   intro (cloudexpo)Lxc – next gen virtualization for cloud   intro (cloudexpo)
Lxc – next gen virtualization for cloud intro (cloudexpo)
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to Kubernetes
 
Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?Cgroups, namespaces and beyond: what are containers made from?
Cgroups, namespaces and beyond: what are containers made from?
 

Similar to Docker's Jérôme Petazzoni: Best Practices in Dev to Production Parity for Containers

Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Yogesh Wadile
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Codemotion
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
Carlo Bonamico
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
Andrey Hristov
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
Andrey Hristov
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
Henryk Konsek
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
Roman Rodomansky
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedback
Nicolas Degardin
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Van Phuc
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
Akihiro Suda
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
Krishna-Kumar
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
RightScale
 
Docker 2014
Docker 2014Docker 2014
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container Security
Phil Estes
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
Arun prasath
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
Megha Bansal
 

Similar to Docker's Jérôme Petazzoni: Best Practices in Dev to Production Parity for Containers (20)

Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Accelerate your development with Docker
Accelerate your development with DockerAccelerate your development with Docker
Accelerate your development with Docker
 
Accelerate your software development with Docker
Accelerate your software development with DockerAccelerate your software development with Docker
Accelerate your software development with Docker
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015Containers: from development to production at DevNation 2015
Containers: from development to production at DevNation 2015
 
Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.Containerize! Between Docker and Jube.
Containerize! Between Docker and Jube.
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedback
 
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker EcosystemDocker-Hanoi @DKT , Presentation about Docker Ecosystem
Docker-Hanoi @DKT , Presentation about Docker Ecosystem
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
 
Evolution of containers to kubernetes
Evolution of containers to kubernetesEvolution of containers to kubernetes
Evolution of containers to kubernetes
 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container Security
 
Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment Docker - Demo on PHP Application deployment
Docker - Demo on PHP Application deployment
 
Containerization and Docker
Containerization and DockerContainerization and Docker
Containerization and Docker
 

More from Heavybit

Brian Doll: Land and Expand Strategies at Github and New Relic
Brian Doll: Land and Expand Strategies at Github and New RelicBrian Doll: Land and Expand Strategies at Github and New Relic
Brian Doll: Land and Expand Strategies at Github and New Relic
Heavybit
 
Brian Balfour: Building A Growth Machine
Brian Balfour: Building A Growth MachineBrian Balfour: Building A Growth Machine
Brian Balfour: Building A Growth Machine
Heavybit
 
451 Group on Analyst Relations
451 Group on Analyst Relations451 Group on Analyst Relations
451 Group on Analyst Relations
Heavybit
 
Sean Byrnes: Business Analytics: Are We There Yet?
Sean Byrnes: Business Analytics: Are We There Yet?Sean Byrnes: Business Analytics: Are We There Yet?
Sean Byrnes: Business Analytics: Are We There Yet?
Heavybit
 
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
Heavybit
 
Creating Killer Trend Stories with Redis Labs' Cameron Peron
Creating Killer Trend Stories with Redis Labs' Cameron PeronCreating Killer Trend Stories with Redis Labs' Cameron Peron
Creating Killer Trend Stories with Redis Labs' Cameron Peron
Heavybit
 
Don MacLennan: Investing in Customer Success
Don MacLennan: Investing in Customer SuccessDon MacLennan: Investing in Customer Success
Don MacLennan: Investing in Customer Success
Heavybit
 
Stripe's Krithika Muthukumar: Effective Launches
Stripe's Krithika Muthukumar: Effective LaunchesStripe's Krithika Muthukumar: Effective Launches
Stripe's Krithika Muthukumar: Effective Launches
Heavybit
 
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
Heavybit
 
Heavybit Event Manager
Heavybit Event ManagerHeavybit Event Manager
Heavybit Event Manager
Heavybit
 
Heavybit is Hiring an Events Manager
Heavybit is Hiring an Events ManagerHeavybit is Hiring an Events Manager
Heavybit is Hiring an Events ManagerHeavybit
 
Jeff Gothelf: Lean Product Design
Jeff Gothelf: Lean Product DesignJeff Gothelf: Lean Product Design
Jeff Gothelf: Lean Product Design
Heavybit
 
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
Heavybit
 
Charity Majors - Bootstrapping an Ops Team
Charity Majors - Bootstrapping an Ops TeamCharity Majors - Bootstrapping an Ops Team
Charity Majors - Bootstrapping an Ops Team
Heavybit
 
Looker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right QuestionsLooker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right Questions
Heavybit
 
Heroku's Craig Kerstiens: Developer Marketing Channels
Heroku's Craig Kerstiens: Developer Marketing ChannelsHeroku's Craig Kerstiens: Developer Marketing Channels
Heroku's Craig Kerstiens: Developer Marketing Channels
Heavybit
 
Harrison Metal's Michael Dearing on Pricing
Harrison Metal's Michael Dearing on PricingHarrison Metal's Michael Dearing on Pricing
Harrison Metal's Michael Dearing on Pricing
Heavybit
 
Slack's Ali Rayl on Scaling Support for User Growth
Slack's Ali Rayl on Scaling Support for User GrowthSlack's Ali Rayl on Scaling Support for User Growth
Slack's Ali Rayl on Scaling Support for User Growth
Heavybit
 
Stripe's Amber Feng on API Design
Stripe's Amber Feng on API DesignStripe's Amber Feng on API Design
Stripe's Amber Feng on API Design
Heavybit
 

More from Heavybit (19)

Brian Doll: Land and Expand Strategies at Github and New Relic
Brian Doll: Land and Expand Strategies at Github and New RelicBrian Doll: Land and Expand Strategies at Github and New Relic
Brian Doll: Land and Expand Strategies at Github and New Relic
 
Brian Balfour: Building A Growth Machine
Brian Balfour: Building A Growth MachineBrian Balfour: Building A Growth Machine
Brian Balfour: Building A Growth Machine
 
451 Group on Analyst Relations
451 Group on Analyst Relations451 Group on Analyst Relations
451 Group on Analyst Relations
 
Sean Byrnes: Business Analytics: Are We There Yet?
Sean Byrnes: Business Analytics: Are We There Yet?Sean Byrnes: Business Analytics: Are We There Yet?
Sean Byrnes: Business Analytics: Are We There Yet?
 
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
Using OKRs to Drive Results AKA "Secrets To Crushing Your Goals"
 
Creating Killer Trend Stories with Redis Labs' Cameron Peron
Creating Killer Trend Stories with Redis Labs' Cameron PeronCreating Killer Trend Stories with Redis Labs' Cameron Peron
Creating Killer Trend Stories with Redis Labs' Cameron Peron
 
Don MacLennan: Investing in Customer Success
Don MacLennan: Investing in Customer SuccessDon MacLennan: Investing in Customer Success
Don MacLennan: Investing in Customer Success
 
Stripe's Krithika Muthukumar: Effective Launches
Stripe's Krithika Muthukumar: Effective LaunchesStripe's Krithika Muthukumar: Effective Launches
Stripe's Krithika Muthukumar: Effective Launches
 
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
CoreOS' Melissa Smolensky: Minimum Viable Launch, What You Need For Marketing...
 
Heavybit Event Manager
Heavybit Event ManagerHeavybit Event Manager
Heavybit Event Manager
 
Heavybit is Hiring an Events Manager
Heavybit is Hiring an Events ManagerHeavybit is Hiring an Events Manager
Heavybit is Hiring an Events Manager
 
Jeff Gothelf: Lean Product Design
Jeff Gothelf: Lean Product DesignJeff Gothelf: Lean Product Design
Jeff Gothelf: Lean Product Design
 
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
Jeff Atwood - How to Talk So Your Community Will Listen and Listen So Your Co...
 
Charity Majors - Bootstrapping an Ops Team
Charity Majors - Bootstrapping an Ops TeamCharity Majors - Bootstrapping an Ops Team
Charity Majors - Bootstrapping an Ops Team
 
Looker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right QuestionsLooker's Ben Porterfield - Asking The Right Questions
Looker's Ben Porterfield - Asking The Right Questions
 
Heroku's Craig Kerstiens: Developer Marketing Channels
Heroku's Craig Kerstiens: Developer Marketing ChannelsHeroku's Craig Kerstiens: Developer Marketing Channels
Heroku's Craig Kerstiens: Developer Marketing Channels
 
Harrison Metal's Michael Dearing on Pricing
Harrison Metal's Michael Dearing on PricingHarrison Metal's Michael Dearing on Pricing
Harrison Metal's Michael Dearing on Pricing
 
Slack's Ali Rayl on Scaling Support for User Growth
Slack's Ali Rayl on Scaling Support for User GrowthSlack's Ali Rayl on Scaling Support for User Growth
Slack's Ali Rayl on Scaling Support for User Growth
 
Stripe's Amber Feng on API Design
Stripe's Amber Feng on API DesignStripe's Amber Feng on API Design
Stripe's Amber Feng on API Design
 

Recently uploaded

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 

Recently uploaded (20)

GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 

Docker's Jérôme Petazzoni: Best Practices in Dev to Production Parity for Containers

  • 2. Who am I? Jérôme Petazzoni (@jpetazzo) French software engineer living in California Joined Docker (dotCloud) more than 4 years ago (I was at Docker before it was cool!) I have built and scaled the dotCloud PaaS I learned a few things about running containers (in production) 2 / 49
  • 3. Outline Brief intro about Docker and containers VMs and containers: technical differences VMs and containers: functional differences Lean containers Composing stacks of containers 3 / 49
  • 4. Brief intro about Docker and containers 4 / 49
  • 5. Build, ship, and run any app, anywhere 5 / 49
  • 6. Take any Linux program, and put it in a container Web apps and services, workers (Go, Java, Node, PHP, Python, Ruby...) Data stores: SQL, NoSQL, big data (Cassandra, ElasticSearch, Hadoop, Mongo, MySQL, PostgreSQL, Redis...) Other server-y things (Consul, Etcd, Mesos, RabbitMQ, Zookeeper...) Command-line tools (AWS CLI, Ffmpeg...) Desktop apps (Chrome, LibreOffice, Skype, Steam...) 6 / 49
  • 7. What about non-Linux programs? Desktop apps with WINE (e.g.: Spotify client) Coming soon: Docker for Windows (run Windows apps on Windows machines) Coming soon: Docker for FreeBSD (port in progress) Coming eventually: Docker for OS X (technically possible; but is this useful?) 7 / 49
  • 8. Ship that container easily and efficiently Docker comes with an image distribution protocol Distribution server can be hosted by Docker Inc. (free for public images) Distribution protocol is public Open source reference implementation (used by Docker Inc. for the public registry) Container images are broken down into layers When updating and distributing an image, only ship relevant layers 8 / 49
  • 9. Run those containers anywhere Containers can run in VMs or in physical machines Docker is available on all modern Linux variants Many IAAS providers have server images with Docker On OS X and Windows dev machines: boot2docker There are distros dedicated to run Docker containers (Atomic, CoreOS, RancherOS, Snappy Core...) Other Docker implementations exist (e.g. Joyent Triton) 9 / 49
  • 11. Containers are portable VMs can't easily be moved nested hypervisors (VMs in VMs) exist, but still rare VM images have to be converted and transferred (both are slow operations) The same container can run on any machine (physical or virtual) Containers use a stable interface Intel 64 bits machine code Linux system calls ABI 11 / 49
  • 12. Containers have low overhead Normal* process(es) running on top of normal kernel No device emulation (no extra code path involved in I/O) Context switch between containers = context switch between processes Benchmarks show no difference at all between containers and bare metal (after adequate tuning and options have been selected) Containers have higher density * There are extra "labels" denoting membership to given namespaces and control groups. Similar to regular UID. 12 / 49
  • 13. VMs have stronger isolation Inter-VM communication must happen over the network (Some hypervisors have custom paths, but non-standard) VMs can run as non-privileged processes on the host (Breaking out of a VM will have ~zero security impact) Containers run on top of a single kernel (Kernel vulnerability can lead to full scale compromise) Containers can share files, sockets, FIFOs, memory areas... (They can communicate with standard UNIX mechanisms) 13 / 49
  • 14. Analogy: brick walls vs. room dividers Brick walls sturdy slow to build messy to move Room dividers fragile deployed in seconds moved easily 14 / 49
  • 15. Blurring lines Intel Clear Containers; Clever Cloud (stripped down VMs, boot super fast, tiny footprint) Joyent Triton (Solaris "branded zones," running Linux binaries securely, exposing the Docker API) Ongoing efforts to harden containers (GRSEC, SELinux, AppArmor) 15 / 49
  • 17. Inside VMs typically contains* everything they need (Backups, logging, periodic job execution, remote access...) Containers are the subject of an epic debate: machine container (runs init, cron, ssh, syslog ... and the app) application container (runs the app and nothing else; relies on external mechanisms) * No pun intended! 17 / 49
  • 18. Creation / deployment Containers are (typically) created from an image Updates = update the image, redeploy a new container "Immutable servers" pattern VMs can use the same pattern ("golden images"), but it's heavier to setup VMs often have a long lifecycle instead (provisioning→update→update→…→update→disposal) easily leads to configuration drift (subtle differences that add up over time) requires tight configuration management 18 / 49
  • 19. Development process (VMs) Hypothesis: app broken down in 10 components Production: 10+ VMs (each component in 1+ VM) Development: typically 1 VM for whole app Different components depending on environment (e.g.: logging, monitoring, service discovery...) Consequence: prod and dev deployments differ a lot 19 / 49
  • 20. Development process (containers) Hypothesis: app broken down in 10 components Production: 10+ containers (across any number of VMs) Development: 10 containers on 1 dev VM Re-use the same container images for prod and dev How do we provide container variants? 20 / 49
  • 21. Bloated containers Containers have all the software required for production In dev mode, only essential processes are started In prod mode, additional processes run as well Problems: bigger containers behavior can differ (because of extra processes) extra processes duplicated between containers hard to test those extra processes in isolation 21 / 49
  • 23. Principle "Do one thing, do it well" One container for the component itself One container for logging One container for monitoring One container for backups One container for debugging (when needed) etc. 23 / 49
  • 24. Implementation (general principles) Containers can share almost anything, selectively files (logs, data at rest, audit) network stack (traffic routing and analysis, monitoring) process space, memory (process tracing and debugging) 24 / 49
  • 25. Let's dive into the details 25 / 49
  • 26. Logging (option 1: Docker logging drivers) Containers write to standard output Docker has different logging drivers: writes to local JSON files by default can send to syslog Imperfect solution for now, but will be improved. Preferred in the long run. 26 / 49
  • 27. Logging (option 2: shared log directory) Containers write regular files to a directory That directory is shared with another container dockerrun-d--namemyapp1-v/var/logmyapp:v1.0 In development setup: dockerrun--volumes-frommyapp1ubuntu sh-c'tail-F/var/log/*' In production: dockerrun-d--volumes-frommyapp1logcollector 27 / 49
  • 28. Logging takeaways Application can be "dumb" about logging Log collection and shipping happens in Docker, or in separate(s) container(s) Run custom log analyzer without changing app container (e.g. apachetop) Migrate logging system without changing app container 28 / 49
  • 29. "Yes, but..." "What about performance overhead?" no performance overhead both containers access files directly (just like processes running on the same machine) "What about synchronization issues?" same as previous answer! 29 / 49
  • 30. Backups (file-based) Store mutable data on Docker volumes (same mechanism as for logs) Share volumes with special-purpose backup containers Put backup tools in the backup container (boto, rsync, s3cmd, unison...) dockerrun--volumes-frommydb1ubuntu rsync-av/var/lib/backup@remotehost:mydb1/ The whole setup doesn't touch the app (or DB) container 30 / 49
  • 31. Backups (network-based) Run the backup job (pg_dump, mysqldump, etc.) from a separate container Nothing complicated, but with VMs, this is overkill ("this VM does nothing at all; except a few minutes per day!") Advantages (vs. running in the same container): nothing to install in the app (or DB) container if the backup job runs amok, it remains contained (!) 31 / 49
  • 32. Network analysis Packet capture (tcpdump, ngrep, ntop, etc.) Low-level metrics (netstat, ss, etc.) Install required tools in a separate container image Run a container in the same network namespace dockerrun-d--nameweb1nginx dockerrun-ti--netcontainer:web1tcpdump-pnieth0 dockerrun-ti--netcontainer:web1ubuntuss-n--tcp 32 / 49
  • 33. Service discovery Docker can do linking and generic DNS injection Your code connects to e.g. redis (pretending that redisresolves to something) Docker adds a DNS alias* so that redisresolves to the right container, or to some external service In dev, Docker Compose manages service dependencies In prod, you abstract service discovery from the container * Really, an entry in the container's /etc/hosts. 33 / 49
  • 34. Service discovery in practice When service A needs to talk to service B... 1. Start container B on a Docker host 34 / 49
  • 35. Service discovery in practice When service A needs to talk to service B... 1. Start container B on a Docker host 2. Retrieve host+port allocated for B 35 / 49
  • 36. Service discovery in practice When service A needs to talk to service B... 1. Start container B on a Docker host 2. Retrieve host+port allocated for B 3. Start ambassador (relaying to this host+port) 36 / 49
  • 37. Service discovery in practice When service A needs to talk to service B... 1. Start container B on a Docker host 2. Retrieve host+port allocated for B 3. Start ambassador (relaying to this host+port) 4. Start container A linked to ambassador 37 / 49
  • 38. Service discovery in practice When service A needs to talk to service B... 1. Start container B on a Docker host 2. Retrieve host+port allocated for B 3. Start ambassador (relaying to this host+port) 4. Start container A linked to ambassador 5. Profit! 38 / 49
  • 39. General pattern Your code runs in the same container in dev and prod Add "sidekick*" containers for additional tasks Developers don't have to be bothered about ops Ops can do their job without messing with devs' code * Kubernetes sometimes calls them "sidecars." 39 / 49
  • 43. Docker Compose Start whole stack with docker-composeup Start individual containers (and their dependencies) with docker-composeupxyz Takes care of container lifecycle (creation, update, data persistence, scaling up/down...) Doesn't automatically solve networking and discovery (yet) 43 / 49
  • 44. Docker Compose Start whole stack with docker-composeup Start individual containers (and their dependencies) with docker-composeupxyz Takes care of container lifecycle (creation, update, data persistence, scaling up/down...) Doesn't automatically solve networking and discovery (yet) ... However ... 44 / 49
  • 46. Fair warning Docker networking is evolving quickly Docker 1.7 (to be released Real Soon Now) will support: "networks" as first class objects multiple networks overlay driver allowing to span networks across multiple hosts networking plugins from ecosystem partners 46 / 49
  • 48. Conclusions Containers can share more context than VMs We can use this to decouple complexity (think "microservices" but for ops/devs separation) All tasks typically requiring VM access can be done in separate containers As a result, deployments are broken down in smaller, simpler pieces Complex stacks are expressed with simple YAML files Docker isn't a "silver bullet" to solve all problems, but it gives us tools that make our jobs easier 48 / 49