SlideShare a Scribd company logo
Introduction	to	Docker
Peng Xiao
GitHub: xiaopeng163
Network Consulting Engineer
Cisco Systems
Contents
• The Metrix from Hell
• What is Container/Docker?
• Docker Basic Usage
• Docker Networking Deep Dive
• Docker Compose
• Docker Swarm
• Ecosystem and Standardization
Static website
Web frontend
User DB
Queue Analytics DB
Background workers
API endpoint
nginx 1.5 + modsecurity + openssl + bootstrap 2
postgresql + pgv8 + v8
hadoop + hive + thrift + OpenJDK
Ruby + Rails + sass + Unicorn
Redis + redis-sentinel
Python 3.0 + celery + pyredis + libcurl + ffmpeg + libopencv + nodejs +
phantomjs
Python 2.7 + Flask + pyredis + celery + psycopg + postgresql-client
DevelopmentVM
QA server
Public Cloud
Disaster recovery
Contributor’s laptop
Production Servers
The	ChallengeMultiplicity	of	Stacks
Multiplicity	of	
hardware	
environments
Production Cluster
Customer Data Center
Do	services	and	apps	
interact	
appropriately?
Can	I	migrate	
smoothly	and	
quickly?
The	Matrix	From	Hell
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Developmen
t VM
QA Server
Single Prod
Server
Onsite
Cluster
Public Cloud
Contributor’
s laptop
Customer
Servers
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
? ? ? ? ? ? ?
Static website Web frontendUser DB Queue Analytics DB
Development
VM
QA server Public Cloud Contributor’s
laptop
Docker	is	a	shipping	container	system	for	code	Multiplicity	of	Stacks
Multiplicity	of	
hardware	
environments
Production
Cluster
Customer Data
Center
Do	services	and	apps	
interact	
appropriately?
Can	I	migrate	
smoothly	and	quickly
…that can be manipulated using
standard operations and run
consistently on virtually any
hardware platform
An engine that enables any
payload to be encapsulated
as a lightweight, portable,
self-sufficient container…
Static website
Web frontend
Background workers
User DB
Analytics DB
Queue
Developmen
t VM
QA Server
Single Prod
Server
Onsite
Cluster
Public Cloud
Contributor’
s laptop
Customer
Servers
Docker	eliminates	the	matrix	from	Hell
Why	Developers	Care
• Build	once…(finally)	run	anywhere*
• A	clean,	safe,	hygienic	and	portable	runtime	environment	for	your	app.
• No	worries	about	missing	dependencies,	packages	and	other	pain	points	during	subsequent	
deployments.
• Run	each	app	in	its	own	isolated	container,		so	you	can	run	various	versions	of	libraries	and	other	
dependencies	for	each	app	without	worrying
• Automate	testing,	integration,	packaging…anything	you	can	script	
• Reduce/eliminate	concerns	about	compatibility	on	different	platforms,	either	your	own	or	your	
customers.	
• Cheap,	zero-penalty	containers	to	deploy	services?	A	VM	without	the	overhead	of	a	VM?	Instant	
replay	and	reset	of	image	snapshots?	That’s	the	power	of	Docker
*	With	the	0.7	release,	we	support	any	x86	server	running	a	modern	Linux	kernel	(3.2+	generally.	2.6.32+	for	RHEL	6.5+,	Fedora,	&	
related)
Why	Devops Cares?
• Configure	once…run	anything
• Make	the	entire	lifecycle	more	efficient,	consistent,	and	repeatable
• Increase	the	quality	of	code	produced	by	developers.	
• Eliminate	inconsistencies	between	development,	test,	production,	and	customer	environments
• Support	segregation	of	duties
• Significantly	improves	the	speed	and	reliability	of	continuous	deployment	and	continuous	
integration	systems
• Because	the	containers	are	so	lightweight,	address	significant	performance,	costs,	deployment,	and	
portability	issues	normally	associated	with	VMs
Contents
• The Metrix from Hell
•What is Container/Docker?
• Docker Basic Usage
• Docker Networking Deep Dive
• Docker Compose
• Docker Swarm
• Ecosystem and Standardization
Container History
http://kiwenlau.blogspot.com/2015/01/linux-container-technology-overview.html
Docker is nothing new, it just show in the right time
App
A
Containers	vs.	VMs	
Hypervisor	(Type	2)
Host	OS
Server
Guest
OS
Bins/
Libs
App
A’
Guest
OS
Bins/
Libs
App
B
Guest
OS
Bins/
Libs
App	A’
Docker
Host	OS
Server
Bins/Libs
App	A
Bins/Libs
App	B
App	B’
App	B’
App	B’
VM
Container
Containers	are	isolated,
but	share	OS	and,	where
appropriate,	bins/libraries
Guest
OS
Guest
OS
…result	is	significantly	faster	deployment,		
much	less	overhead,	easier	migration,	
faster	restart
Why	are	Containers	lightweight?
Bins/
Libs
App
A
Original	App
(No	OS	to	take
up	space,	resources,
or	require	restart)
App	Δ
Bins/
App
A
Bins/
Libs
App
A’
Guest
OS
Bins/
Libs
Modified	App
Copy	on	write	
capabilities	allow
us	to	only	save	the	diffs
Between	container	A	
and	container
A’
VMs
Every	app,	every	copy	of	an
app,	and	every	slight	modification
of	the	app	requires	a	new	virtual	server
App
A
Guest
OS
Bins/
Libs
Copy	of
App
No	OS.	Can
Share	bins/libs
App
A
Guest
OS
Guest
OS
VMs Containers
Docker Inside
Docker Inside (Deep Dive)
• A	Deep	Dive	Into	Linux	Containers	For	Engineers	Interested	In	The	
Gritty	Details. http://docker-saigon.github.io/post/Docker-Internals/
• Cgroups,	namespaces,	and	beyond:	what	are	containers	made	from?	
(DockerCon Europe	2015) https://goo.gl/25KtpZ
Contents
• The Metrix from Hell
• What is Container/Docker?
•Docker Basic Usage
• Docker Networking Deep Dive
• Docker Compose
• Docker Swarm
• Ecosystem and Standardization
Docker	Engine
• Docker	Daemon	+	REST(ish)	API
• Docker	Client	(CLI)	talks	to	the	API
• Daemon	manages	the	Docker	containers
• Start	it	with:	docker –d
• docker version	to	test	if	docker is	setup	correctly
• Docker	Engine	(Linux,	Mac,	Windows)
• https://docs.docker.com/engine/installation/
Docker	Toolbox
• Docker	Toolbox	is	an	installer	for	quick	setup	and	launch	of	a	Docker	
environment	on	older	Mac	and	Windows	systems	that	do	not	meet	
the	requirements	of	the	new	Docker	for	Mac	and	Docker	for	Windows	
apps.
Docker	Machine
• Machine	makes	it	really	easy	to	create	Docker	hosts	on	your	computer,	on	
cloud	providers	and	inside	your	own	data	center.	It	creates	servers,	installs	
Docker	on	them,	then	configures	the	Docker	client	to	talk	to	them.
• Drivers	exist	for:
• AWS
• DigitalOcean
• Azure
• Google	Compute	Engine
• Rackspace
• OpenStack
• Virtualbox
• VMWare	Fusion
• VMWare	vSphere
• Hyperv
Docker Images	vs	Containers
• Images:	About	storing	or	moving	your	app
• Containers:	About	running	your	app
https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/
Docker Workflow——Build/Pull/Push
Source	
Code	
Repository
Dockerfile
For	
A
Docker	Engine
Docker
Container
Image	
Registry
Build
Docker	
Host	2	OS		(Linux)
Container	A
Container	B
Container	C
Container	A
Push
Search
Pull
Run
Host	1		OS	(Linux)
Docker	Image
• Download,	list,	remove	images
https://hub.docker.com/
Dockerfile
Create a Dockerfile
Build a image
https://docs.docker.com/engine/reference/builder/
Docker	Container
• Create and start a container
• Inside of the container
Docker	Container
• Stop and remove a container
http://docker-k8s-lab.readthedocs.io/en/latest/docker/docker-cli.html
Contents
• The Metrix from Hell
• What is Container/Docker?
• Docker Basic Usage
•Docker Networking Deep Dive
• Docker Compose
• Docker Swarm
• Ecosystem and Standardization
Docker Networking
Container	Network	Model
https://github.com/docker/libnetwork/blob/master/docs/design.md
CNM Drivers
Demo: Docker Bridge Network
• http://docker-k8s-lab.readthedocs.io/en/latest/docker/bridged-
network.html
Docker Multi-Host Networking
• Tunnel
• Docker build-in overlay network: VXLAN
• OVS: VXLAN or GRE
• Flannel: VXLAN or UDP
• Weave: VXLAN or UDP
• Routing
• Calico: Layer 3 routing based on BGP
• Contiv: Layer 3 routing based on BGP
http://blog.dataman-inc.com/shurenyun-docker-133/
Lab A: Overlay Multi-Host Networking with OVS
• http://docker-k8s-lab.readthedocs.io/en/latest/docker/docker-
ovs.html
Linux bridge
docker0
br-int gre0
eth0
eth0 eth0
Host 1
Docker
Container 2Container 1
Open vSwitch
Linux bridge
docker0
br-intgre0
eth0
eth0 eth0
Host 2
Docker
Container 2Container 1
Open vSwitch
GRE tunnel
Lab B:Multi-Host Overlay	Networking	with	Etcd
• http://docker-k8s-lab.readthedocs.io/en/latest/docker/docker-
etcd.html
Docker	1.12	Networking	Model	Overview
Contents
• The Metrix from Hell
• What is Container/Docker?
• Docker Basic Usage
• Docker Networking Deep Dive
•Docker Compose
• Docker Swarm
• Ecosystem and Standardization
Docker	Compose	Overview
• Compose	is	a	tool	for	defining	and	running	multi-container	Docker	applications.	
With	Compose,	you	use	a	Compose	file	to	configure	your	application’s	services.	
Then,	using	a	single	command,	you	create	and	start	all	the	services	from	your	
configuration.
• Defined	in	yaml
Demo: Docker Compose
• Example	Voting	App
• https://github.com/DaoCloud/example-voting-app
• Guide:
• http://docker-k8s-lab.readthedocs.io/en/latest/docker/docker-compose.html
Contents
• The Metrix from Hell
• What is Container/Docker?
• Docker Basic Usage
• Docker Networking Deep Dive
• Docker Compose
•Docker Swarm
• Ecosystem and Standardization
Before Docker Swarm
With Docker Swarm
grpc
raft	consensus	group
gossip	network
http://www.grpc.io/
http://thesecretlivesofdata.com/raft/
https://en.wikipedia.org/wiki/Gossip_protocol
Docker Orchestration Components
http://www.slideshare.net/ajeetraina/service-discovery-loadbalancing-under-docker-1120-docker-meetup-22
Create Docker Service
https://www.youtube.com/watch?v=_F6PSP-qhdA
http://collabnix.com/archives/1445
Demo: Docker Swarm
• Docker Swarm with Load Balancing and Scaling
• http://docker-k8s-lab.readthedocs.io/en/latest/docker/docker-swarm-lb-
scale.html
• Multi-Services issue
• https://github.com/docker/compose/issues/3656
Contents
• The Metrix from Hell
• What is Container/Docker?
• Docker Basic Usage
• Docker Networking Deep Dive
• Docker Compose
• Docker Swarm
•Ecosystem and Standardization
Container Ecosystem
Open	Container	Initiative (OCI)
• A Linux Foundation Collaborative Project
• Free from control by any particular vendor’s specfic cloud stack or
ecosystem
• Includes:
• Container runtime specification -> runc
• Image format specification
http://www.slideshare.net/PhilEstes/runc-the-little-engine-that-could-run-docker-containers
https://www.opencontainers.org/
https://github.com/opencontainers
Container Networking
• Container Network Model (CNM) by Docker
• Adopted by Docker libnetwork, Cisco Contiv, Kuryr, OVN, Project Calico,
Vmware, Vwave
• Container Network Interface(CNI) by CoreOS
• Adopted by kuberntes, Kurma, rkt, Apache Mesos, Clould Foundry, Cisco
Contiv, Project Calico and Weave.
http://thenewstack.io/container-networking-landscape-cni-coreos-cnm-docker/
https://github.com/containernetworking
?

More Related Content

PPTX
Getting started with Docker
PPTX
Docker 101 : Introduction to Docker and Containers
PDF
Introduction to Docker
PPTX
Docker Basics
PDF
Docker in real life
PPTX
Docker: From Zero to Hero
PDF
Docker 101: Introduction to Docker
PPT
Docker introduction
Getting started with Docker
Docker 101 : Introduction to Docker and Containers
Introduction to Docker
Docker Basics
Docker in real life
Docker: From Zero to Hero
Docker 101: Introduction to Docker
Docker introduction

What's hot (20)

PPTX
Docker introduction
PDF
Introduction to container based virtualization with docker
PDF
Introduction to Docker Compose
PPTX
Introduction to docker
PPTX
Docker introduction & benefits
PDF
Introduction to docker
PPTX
What is Docker
PPTX
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
PPTX
Introduction to kubernetes
PDF
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
PDF
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
PDF
Introduction to Docker - VIT Campus
PPTX
Docker introduction for the beginners
PDF
Kubernetes Basics
PPTX
Kubernetes for Beginners: An Introductory Guide
PDF
Introduction to Docker
PDF
Docker Swarm 0.2.0
PPTX
Docker introduction (1)
PPTX
Docker basics
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Docker introduction
Introduction to container based virtualization with docker
Introduction to Docker Compose
Introduction to docker
Docker introduction & benefits
Introduction to docker
What is Docker
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Introduction to kubernetes
Docker vs VM | | Containerization or Virtualization - The Differences | DevOp...
Docker Explained | What Is A Docker Container? | Docker Simplified | Docker T...
Introduction to Docker - VIT Campus
Docker introduction for the beginners
Kubernetes Basics
Kubernetes for Beginners: An Introductory Guide
Introduction to Docker
Docker Swarm 0.2.0
Docker introduction (1)
Docker basics
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Ad

Viewers also liked (20)

PDF
Introduction To Docker
PDF
containerd and CRI
PDF
Driving containerd operations with gRPC
PPTX
Docker Online Meetup: Announcing Docker CE + EE
PPTX
Introduction Into Docker Ecosystem
PDF
[DockerHN_2nd_meetup] Ecosystem & Orchestration Tools
PDF
AWS Elastic Container Service - DockerHN
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
PDF
Easy applications deployment on OpenStack clouds
PDF
From zero to Docker
PPTX
Docker, From zero to hero
PDF
PDF
Dockers zero to hero - (medium version)
PDF
Docker: from zero to nonzero
PDF
Docker Orchestrators
PDF
Rabbit mq messaginginthecloud_v_mworld_2010_ms
PPTX
Introduction to Docker
PPSX
From Zero to Hero - Nexinto
PDF
Docker 101 - from 0 to Docker in 30 minutes
PDF
DockerCon 2016 Ecosystem - Everything You Need to Know About Docker and Stora...
Introduction To Docker
containerd and CRI
Driving containerd operations with gRPC
Docker Online Meetup: Announcing Docker CE + EE
Introduction Into Docker Ecosystem
[DockerHN_2nd_meetup] Ecosystem & Orchestration Tools
AWS Elastic Container Service - DockerHN
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Easy applications deployment on OpenStack clouds
From zero to Docker
Docker, From zero to hero
Dockers zero to hero - (medium version)
Docker: from zero to nonzero
Docker Orchestrators
Rabbit mq messaginginthecloud_v_mworld_2010_ms
Introduction to Docker
From Zero to Hero - Nexinto
Docker 101 - from 0 to Docker in 30 minutes
DockerCon 2016 Ecosystem - Everything You Need to Know About Docker and Stora...
Ad

Similar to Docker Introduction (20)

PDF
Docker fundamentals
PDF
Introduction to Docker and Monitoring with InfluxData
PPTX
Dockerize the World - presentation from Hradec Kralove
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
PPTX
Dockerize the World
PDF
Docker From Scratch
PPTX
Everything you need to know about Docker
PDF
Docker up and Running For Web Developers
PDF
Docker Up and Running for Web Developers
PDF
Docker Introduction
PPTX
You, and Me, and Docker Makes Three
PDF
Introduction to Docker at the Azure Meet-up in New York
PPTX
Intro Docker october 2013
PDF
Introduction to Docker at Glidewell Laboratories in Orange County
PPTX
Docker introduction
PPTX
Docker introduction (1)
PPTX
Docker introduction (1)
PDF
Introduction to Docker and Containers
PPTX
Docker 101 describing basic docker usage
PDF
Accelerate your software development with Docker
Docker fundamentals
Introduction to Docker and Monitoring with InfluxData
Dockerize the World - presentation from Hradec Kralove
Docker 0.11 at MaxCDN meetup in Los Angeles
Dockerize the World
Docker From Scratch
Everything you need to know about Docker
Docker up and Running For Web Developers
Docker Up and Running for Web Developers
Docker Introduction
You, and Me, and Docker Makes Three
Introduction to Docker at the Azure Meet-up in New York
Intro Docker october 2013
Introduction to Docker at Glidewell Laboratories in Orange County
Docker introduction
Docker introduction (1)
Docker introduction (1)
Introduction to Docker and Containers
Docker 101 describing basic docker usage
Accelerate your software development with Docker

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced IT Governance
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
DOCX
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Electronic commerce courselecture one. Pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Understanding_Digital_Forensics_Presentation.pptx
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced IT Governance
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Diabetes mellitus diagnosis method based random forest with bat algorithm
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Reach Out and Touch Someone: Haptics and Empathic Computing
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
The AUB Centre for AI in Media Proposal.docx

Docker Introduction