SlideShare a Scribd company logo
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

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

?

staging

prod on
cloud
VM

my
laptop

your
laptop

QA

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 host distro

–
●

regardless of kernel version
(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
Changing
large files
Diffing

Superfast
Supercheap

Fast
Cheap

Fast
Costly

Slow (first time)
Inefficient (copy-up!)

Fast
Cheap

Fast
Cheap

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
A Gentle Introduction To Docker And All Things Containers
Docker-what?
●

Open Source engine to commoditize LXC

●

using copy-on-write for quick provisioning

STOP!
HAMMER DEMO TIME.
A Gentle Introduction To Docker And All Things Containers
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
RUN
RUN
RUN
RUN

apt-get
apt-get
apt-get
apt-get
apt-get

-y update
install -y
install -y
install -y
install -y

g++
erlang-dev erlang-manpages erlang-base-hipe ...
libmozjs185-dev libicu-dev libtool ...
make wget

RUN wget http://.../apache-couchdb-1.3.1.tar.gz | tar -C /tmp -zxfRUN 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.
–
–

storage? cp!

–
●

execution? chroot!
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

More Related Content

What's hot (20)

PPTX
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
PPTX
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
PPTX
Introduction to kubernetes
Rishabh Indoria
 
PDF
Docker Introduction
Sparkbit
 
PDF
Kubernetes
erialc_w
 
PPTX
Getting started with Docker
Ravindu Fernando
 
PDF
Midi technique - présentation docker
Olivier Eeckhoutte
 
PDF
Intro docker
Fedir RYKHTIK
 
PDF
Docker Introduction
Peng Xiao
 
PDF
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
PPTX
Docker 101 - Nov 2016
Docker, Inc.
 
PDF
Docker Introduction
Robert Reiz
 
PPTX
Docker.pptx
balaji257
 
PPTX
Container orchestration overview
Wyn B. Van Devanter
 
PPT
Docker introduction
Phuc Nguyen
 
PDF
Docker and the Linux Kernel
Docker, Inc.
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PDF
Docker in real life
Nguyen Van Vuong
 
PDF
Kubernetes Application Deployment with Helm - A beginner Guide!
Krishna-Kumar
 
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Simplilearn
 
Cloud Native: what is it? Why?
Juan Pablo Genovese
 
Introduction to kubernetes
Rishabh Indoria
 
Docker Introduction
Sparkbit
 
Kubernetes
erialc_w
 
Getting started with Docker
Ravindu Fernando
 
Midi technique - présentation docker
Olivier Eeckhoutte
 
Intro docker
Fedir RYKHTIK
 
Docker Introduction
Peng Xiao
 
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
Docker 101 - Nov 2016
Docker, Inc.
 
Docker Introduction
Robert Reiz
 
Docker.pptx
balaji257
 
Container orchestration overview
Wyn B. Van Devanter
 
Docker introduction
Phuc Nguyen
 
Docker and the Linux Kernel
Docker, Inc.
 
Kubernetes Basics
Eueung Mulyana
 
Docker in real life
Nguyen Van Vuong
 
Kubernetes Application Deployment with Helm - A beginner Guide!
Krishna-Kumar
 

Viewers also liked (15)

PPTX
Docker introduction
dotCloud
 
PDF
Docker by Example - Basics
Ganesh Samarthyam
 
PDF
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Jérôme Petazzoni
 
PPTX
Immutable infrastructure with Docker and EC2
dotCloud
 
PPTX
vSphere Integrated Containers 101 and End-User Workflow
Simone Morellato
 
PDF
Container Orchestration Wars (2017 Edition)
Karl Isenberg
 
PPTX
Cloud service models 101
Nagaraj Shenoy
 
PDF
Practical PaaS presentation
hmalphettes
 
PPTX
DevOps 101
Donnie Berkholz
 
PDF
Containers and microservices for realists
Karthik Gaekwad
 
PPTX
Why Docker
dotCloud
 
PPTX
Platform as a Service (PaaS)
Halil Burak Cetinkaya
 
PDF
Docker 101: Introduction to Docker
Docker, Inc.
 
PDF
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Kai Wähner
 
PDF
Container Orchestration Wars
Karl Isenberg
 
Docker introduction
dotCloud
 
Docker by Example - Basics
Ganesh Samarthyam
 
Anatomy of a Container: Namespaces, cgroups & Some Filesystem Magic - LinuxCon
Jérôme Petazzoni
 
Immutable infrastructure with Docker and EC2
dotCloud
 
vSphere Integrated Containers 101 and End-User Workflow
Simone Morellato
 
Container Orchestration Wars (2017 Edition)
Karl Isenberg
 
Cloud service models 101
Nagaraj Shenoy
 
Practical PaaS presentation
hmalphettes
 
DevOps 101
Donnie Berkholz
 
Containers and microservices for realists
Karthik Gaekwad
 
Why Docker
dotCloud
 
Platform as a Service (PaaS)
Halil Burak Cetinkaya
 
Docker 101: Introduction to Docker
Docker, Inc.
 
Microservices, Containers, Docker and a Cloud-Native Architecture in the Midd...
Kai Wähner
 
Container Orchestration Wars
Karl Isenberg
 
Ad

Similar to A Gentle Introduction To Docker And All Things Containers (20)

PDF
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
PDF
Introduction to Docker and Containers
Docker, Inc.
 
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
PDF
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Jérôme Petazzoni
 
PDF
Introduction to Docker (as presented at December 2013 Global Hackathon)
Jérôme Petazzoni
 
PDF
Docker and-containers-for-development-and-deployment-scale12x
rkr10
 
PDF
Docker Introduction + what is new in 0.9
Jérôme Petazzoni
 
PDF
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Jérôme Petazzoni
 
PDF
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
Yandex
 
PDF
Docker_AGH_v0.1.3
Witold 'Ficio' Kopel
 
PDF
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Jérôme Petazzoni
 
PDF
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
PDF
Docker handons-workshop-for-charity
Yusuf Hadiwinata Sutandar
 
PDF
Introduction to Docker at Glidewell Laboratories in Orange County
Jérôme Petazzoni
 
PDF
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Jérôme Petazzoni
 
PDF
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
PDF
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
PDF
Introduction to Docker and deployment and Azure
Jérôme Petazzoni
 
A Gentle Introduction to Docker and Containers
Docker, Inc.
 
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
dotCloud
 
Introduction to Docker and Containers
Docker, Inc.
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Jérôme Petazzoni
 
Introduction to Docker (as presented at December 2013 Global Hackathon)
Jérôme Petazzoni
 
Docker and-containers-for-development-and-deployment-scale12x
rkr10
 
Docker Introduction + what is new in 0.9
Jérôme Petazzoni
 
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Jérôme Petazzoni
 
"Lightweight Virtualization with Linux Containers and Docker". Jerome Petazzo...
Yandex
 
Docker_AGH_v0.1.3
Witold 'Ficio' Kopel
 
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Jérôme Petazzoni
 
Agile Brown Bag - Vagrant & Docker: Introduction
Agile Partner S.A.
 
Docker handons-workshop-for-charity
Yusuf Hadiwinata Sutandar
 
Introduction to Docker at Glidewell Laboratories in Orange County
Jérôme Petazzoni
 
Docker 1 0 1 0 1: a Docker introduction, actualized for the stable release of...
Jérôme Petazzoni
 
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
Docker and Containers for Development and Deployment — SCALE12X
Jérôme Petazzoni
 
Introduction to Docker and deployment and Azure
Jérôme Petazzoni
 
Ad

More from Jérôme Petazzoni (20)

PDF
Use the Source or Join the Dark Side: differences between Docker Community an...
Jérôme Petazzoni
 
PDF
Orchestration for the rest of us
Jérôme Petazzoni
 
PDF
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Jérôme Petazzoni
 
PDF
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Jérôme Petazzoni
 
PDF
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Jérôme Petazzoni
 
PDF
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Jérôme Petazzoni
 
PDF
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni
 
PDF
How to contribute to large open source projects like Docker (LinuxCon 2015)
Jérôme Petazzoni
 
PDF
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
PDF
Microservices. Microservices everywhere! (At OSCON 2015)
Jérôme Petazzoni
 
PDF
Deploy microservices in containers with Docker and friends - KCDC2015
Jérôme Petazzoni
 
PDF
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
PDF
Immutable infrastructure with Docker and containers (GlueCon 2015)
Jérôme Petazzoni
 
PDF
The Docker ecosystem and the future of application deployment
Jérôme Petazzoni
 
PDF
Docker: automation for the rest of us
Jérôme Petazzoni
 
PDF
Docker Non Technical Presentation
Jérôme Petazzoni
 
PDF
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
PDF
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
PDF
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
PDF
Pipework: Software-Defined Network for Containers and Docker
Jérôme Petazzoni
 
Use the Source or Join the Dark Side: differences between Docker Community an...
Jérôme Petazzoni
 
Orchestration for the rest of us
Jérôme Petazzoni
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Jérôme Petazzoni
 
Docker : quels enjeux pour le stockage et réseau ? Paris Open Source Summit ...
Jérôme Petazzoni
 
Making DevOps Secure with Docker on Solaris (Oracle Open World, with Jesse Bu...
Jérôme Petazzoni
 
Containers, docker, and security: state of the union (Bay Area Infracoders Me...
Jérôme Petazzoni
 
From development environments to production deployments with Docker, Compose,...
Jérôme Petazzoni
 
How to contribute to large open source projects like Docker (LinuxCon 2015)
Jérôme Petazzoni
 
Containers, Docker, and Security: State Of The Union (LinuxCon and ContainerC...
Jérôme Petazzoni
 
Microservices. Microservices everywhere! (At OSCON 2015)
Jérôme Petazzoni
 
Deploy microservices in containers with Docker and friends - KCDC2015
Jérôme Petazzoni
 
Containers: from development to production at DevNation 2015
Jérôme Petazzoni
 
Immutable infrastructure with Docker and containers (GlueCon 2015)
Jérôme Petazzoni
 
The Docker ecosystem and the future of application deployment
Jérôme Petazzoni
 
Docker: automation for the rest of us
Jérôme Petazzoni
 
Docker Non Technical Presentation
Jérôme Petazzoni
 
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
Containers, Docker, and Microservices: the Terrific Trio
Jérôme Petazzoni
 
Containerization is more than the new Virtualization: enabling separation of ...
Jérôme Petazzoni
 
Pipework: Software-Defined Network for Containers and Docker
Jérôme Petazzoni
 

Recently uploaded (20)

PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
Designing Production-Ready AI Agents
Kunal Rai
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Designing Production-Ready AI Agents
Kunal Rai
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Biography of Daniel Podor.pdf
Daniel Podor
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 

A Gentle Introduction To Docker And All Things 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 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? staging prod on cloud VM my laptop your laptop QA 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 host distro – ● regardless of kernel version (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 Changing large files Diffing Superfast Supercheap Fast Cheap Fast Costly Slow (first time) Inefficient (copy-up!) Fast Cheap Fast Cheap 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
  • 28. Docker-what? ● Open Source engine to commoditize LXC ● using copy-on-write for quick provisioning STOP! HAMMER DEMO TIME.
  • 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 RUN RUN RUN RUN apt-get apt-get apt-get apt-get apt-get -y update install -y install -y install -y install -y g++ erlang-dev erlang-manpages erlang-base-hipe ... libmozjs185-dev libicu-dev libtool ... make wget RUN wget http://.../apache-couchdb-1.3.1.tar.gz | tar -C /tmp -zxfRUN 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. – – storage? cp! – ● execution? chroot! we can run everywhere o/ re-add everything as plugins