SlideShare a Scribd company logo
IInnttrroodduuccttiioonn ttoo 
ddoocckkeerr
Introduction to docker
What will be in this talk 
- Overview of docker features 
- Overview of docker building blocks 
- Comparison to other solutions 
- Quick docker tutorial 
- Dockerfile tips
What will not be in this talk 
- Exploiting docker 
- Details of deploying docker infrastructure 
- Deep technical descriptions
Easy to learn
-- EEaassyy ttoo lleeaarrnn 
-- CCooooll wwhhaallee 
-- WWrriitttteenn iinn ggoo
BBuutt sseerriioouussllyy??
Architecture 
changes 
http://martinfowler.com/articles/microservices/images/decentralised-data.png
Features - images 
● Package every app in the same box 
(dependencies, working everywhere) 
● Isolate things from each other 
● Standarized build procedure (Dockerfile)
Containers
Features - containers 
● Managing containers 
– Running & stopping 
– Inspect, logs, top, ps 
– Save & load (from files) 
– Diff & commit 
● Mounting volumens 
– Share data 
– Persistency 
● Easy networking and linking containers
WWoorrkkss oonn 
eevveerryyoonnee''ss 
mmaacchhiinnee
IIssoollaatt iioonn
PPoorrttaabbiilliittyy
Features - workflow 
● Docker deamon and cli 
● Docker hub and registry 
● Image versioning (pull, commit, pull, layers)
DDoocckkeerr bbuuiillddiinngg 
bblloocckkss
HHooww iitt''ss 
ccooookkeedd??
NNaammeessppaacceess 
hhttttpp::////bblloogg..ddoottcclloouudd..ccoomm//uunnddeerr--tthhee--hhoooodd--lliinnuuxx--kkeerrnneellss--oonn-- 
ddoottcclloouudd--ppaarrtt
Namespaces - GOAL 
One of the overall goals of 
namespaces is to support the 
implementation of containers, a tool for 
lightweight virtualization.
Namespaces - HOW 
Wrap a particular global system 
resource in an abstraction that makes 
it appear to the processes within the 
namespace that they have their own 
isolated instance of the global resource
Namespaces - Result 
Processes 'think' that they are 
the only processes on the 
system
Namespaces - Examples 
- pid 
- numbering 
- hierarchy 
- cannot kill / ptrace in other namespaces 
- net 
- 20 apaches at 80 
- mount
CCoonnttrrooll 
ggrroouuppss 
hhttttpp::////bblloogg..ddoottcclloouudd..ccoomm//kkeerrnneell--sseeccrreettss--ffrroomm--tthhee--ppaaaass--ggaarraaggee-- 
ppaarrtt--2244--cc
Control groups 
Measure and limit resource 
usage for groups of 
processes
DDoocckkeerr vvss VVMM
Overhead 
http://www.zdnet.com/what-is-docker-and-why-is-it-so-darn-popular-7000032269/
LLiigghhttwweeiigghhtt 
AAnndd 
ffaasstt
SShhaarriinngg OOSS
HHiigghheerr ddeennssiittyy
NNoott rreeaallllyy aa VVMM
WWhhyy ddoocckkeerr?? 
WWhhyy nnoott llxxcc??
WWhhyy ddoocckkeerr?? 
WWhhyy nnoott llxxcc??
WWhhyy ddoocckkeerr?? 
WWhhyy nnoott llxxcc??
WWhhyy ddoocckkeerr?? 
WWhhyy nnoott llxxcc?? 
http://stackoverflow.com/questions/17989306/what-does-docker-add-to-just-plain-lxc
DDoocckkeerr ttuuttoorriiaall
PPuullll iitt!! 
$ docker pull 
busybox 
● Search docker 
registry for 
repository of given 
name 
● Downloads the 
repository 
● Pulls only changes 
next time
PPuullll iitt!! 
$ docker pull 
busybox 
● Search docker 
registry for repository 
of given name 
● Downloads the 
repository 
● Pulls only changes 
next time
PPuullll iitt!! 
$ docker pull 
busybox 
● Search docker 
registry for repository 
of given name 
● Downloads the 
repository 
● Pulls only changes 
next time
Introduction to docker
RRuunn iitt!! 
$ docker run 
busybox:ubuntu- 
14.04 echo 
"hello" 
● Make sure that image 
is available 
(downloads if not 
found) 
● Create a container 
● Run a command
RRuunn iitt!! 
$ docker run -it 
busybox:ubuntu- 
14.04 sh 
● -it → makes container 
interactive 
● Create a container 
● Give you a shell 
access
More complicated example 
● Run redis in a 
container 
● Run it as a deamon 
● Bind it to network 
● Make storage 
persistent
RRuunn iitt!! 
$ docker run -d -v 
/var/docker/redis:/da 
ta -p 6379:6379 
--name=redis 
dockerfile/redis 
● -d → launch as 
deamon 
● -v 
/var/docker/redi 
s:/data → mount 
directories 
● -p 6379:6379 → 
forward ports
RRuunn iitt!! 
$ docker run -d -v 
/var/docker/redis:/d 
ata -p 6379:6379 
--name=redis 
dockerfile/redis 
● -d → launch as 
deamon 
● -v 
/var/docker/red 
is:/data → 
mount directories 
● -p 6379:6379 → 
forward ports
RRuunn iitt!! 
$ docker run -d -v 
/var/docker/redis:/da 
ta -p 6379:6379 
--name=redis 
dockerfile/redis 
● -d → launch as 
deamon 
● -v 
/var/docker/redi 
s:/data → mount 
directories 
● -p 6379:6379 → 
forward ports
WWaattcchh iitt!! 
$ docker ps 
Prints out information 
about docker 
containers
WWaattcchh iitt!! 
$ docker ps -a 
Prints out information 
about all docker 
containers: 
● Running 
● Exited
WWaattcchh iitt!! 
$ docker logs -t 
--follow 
romantic_enstein 
Get logs from 
stdin/stdout of 
container 
● -t → show timestamp 
● --follow → similar to 
tail -f
WWaattcchh iitt!! 
$ docker inspect 
romantic_enstein 
Get info about 
container 
● Environment 
variables 
● Ports 
● Links
EEnntteerr 
iinnssiiddee!! 
- nsenter 
- ssh 
● nsenter uses 
namespaces 
● Ssh needs ssh server 
inside
TTiiddyy uupp 
- docker rm 
<container_id> 
- docker rmi 
<image_id> 
● Docker images use 
lots of space 
● Docker images can 
clog all your available 
space on server (no 
more pulling from 
registry)
TTiiddyy uupp 
$ docker ps -a | grep 'Exited' | awk '{print $1}' | 
xargs docker rm 
● Get ids of exited containers 
● Remove containers with given ids
RReeppoossiittoorryy 
wwoorrkkffllooww 
● docker diff <container_id> 
● docker commit 
<contaner_id> 
attero/stuff:my-tag 
● Versioning! 
● Tags 
● Multiple versions 
● Push & pull
WWhhaatt wwee lleeaarrnneedd ssoo ffaarr 
Repository workflow 
– Pull 
– Commit 
– Push 
Tidying up after 
containers 
– Rm 
– Rmi 
Monitoring 
– Ps 
– Logs 
– Inspect 
– Top 
Running containers 
– Interactive 
– Deamon 
– Mounting 
– Forwarding
Containers are 
nice
How about automation?
DOCKERFILE
DOCKERFILE 
- Version control 
- Automation 
- Portability
DOCKERFILE 
FROM ubuntu 
MAINTAINER me@me.me 
# Install tmux 
RUN  
apt-get update && apt-get install tmux 
RUN mkdir /home/hello 
# Define working directory. 
WORKDIR /home/hello 
# Define default command. 
CMD ["/bin/bash"]
DOCKERFILE 
FROM ubuntu ← defines base imag 
MAINTAINER me@me.me ← who is reponsible 
# Install tmux 
RUN  
apt-get update && apt-get install tmux 
RUN mkdir /home/hello ← let's run some 
commands 
# Define working directory. 
WORKDIR /home/hello ← let's start here 
# Define default command. 
CMD ["/bin/bash"] ← default command to run 
without arguments in run
DOCKERFILE 
Every command in 
Dockerfile is run on 
a different container
DOCKERFILE 
Don't start services 
in dockerfile.
DOCKERFILE 
Cache! 
- use it 
- save lots of time 
- not changed 
layers are reused
DOCKERFILE 
- short 
- good base image 
- most changing 
things at the bottom
DOCKERFILE 
Every command in 
Dockerfile is run on 
a different container
Learning resources 
● http://docs.docker.com/#installation-guides 
● http://docs.docker.com/reference/builder/ 
● http://docs.docker.com/reference/commandline/cli 
/ 
● https://crosbymichael.com/dockerfile-best-practic 
es.html 
● http://docs.docker.com/articles/basics/ 
● https://www.youtube.com/watch?v=XCVOxht34H 
s 
● https://www.youtube.com/watch?v=9bvdc55xYdo
More Learning resources 
● https://www.digitalocean.com/community/tutoria 
ls/docker-explained-how-to-containerize-python 
-web-applications 
● http://phusion.github.io/baseimage-docker/ 
● https://circleci.com/docs/docker 
● http://docs.docker.com/userguide/usingdocker/
Q&A

More Related Content

PDF
Docker in everyday development
PDF
A Gentle Introduction To Docker And All Things Containers
PDF
Docker - introduction
PDF
Visualising Basic Concepts of Docker
PDF
Docker Introduction + what is new in 0.9
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
ODP
Why Docker? Dayton PHP, April 2017
PPTX
Introduction to Docker
Docker in everyday development
A Gentle Introduction To Docker And All Things Containers
Docker - introduction
Visualising Basic Concepts of Docker
Docker Introduction + what is new in 0.9
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Why Docker? Dayton PHP, April 2017
Introduction to Docker

What's hot (20)

PDF
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
PDF
Docker 101 @KACST Saudi HPC 2016
PDF
The state of the swarm
PPTX
Learn docker in 90 minutes
PDF
Docker from A to Z, including Swarm and OCCS
PPTX
Intro- Docker Native for OSX and Windows
PDF
Docker 101 - from 0 to Docker in 30 minutes
PDF
Orchestrating Docker containers at scale
PDF
Developer workflow with docker
PDF
Docker Introduction
PDF
Docker and Containers for Development and Deployment — SCALE12X
PDF
A Hands-on Introduction to Docker
PDF
Introduction to Docker (as presented at December 2013 Global Hackathon)
PDF
JOSA TechTalk: Taking Docker to Production
PDF
[DockerCon 2019] Hardening Docker daemon with Rootless mode
PPTX
Docker Introductory workshop
PDF
Docker - container and lightweight virtualization
PPTX
Docker Networking - Common Issues and Troubleshooting Techniques
PDF
Ansible docker
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Docker 0.11 at MaxCDN meetup in Los Angeles
Docker 101 @KACST Saudi HPC 2016
The state of the swarm
Learn docker in 90 minutes
Docker from A to Z, including Swarm and OCCS
Intro- Docker Native for OSX and Windows
Docker 101 - from 0 to Docker in 30 minutes
Orchestrating Docker containers at scale
Developer workflow with docker
Docker Introduction
Docker and Containers for Development and Deployment — SCALE12X
A Hands-on Introduction to Docker
Introduction to Docker (as presented at December 2013 Global Hackathon)
JOSA TechTalk: Taking Docker to Production
[DockerCon 2019] Hardening Docker daemon with Rootless mode
Docker Introductory workshop
Docker - container and lightweight virtualization
Docker Networking - Common Issues and Troubleshooting Techniques
Ansible docker
Ad

Viewers also liked (15)

PDF
Docker 101: Introduction to Docker
PDF
Scaling Community Information Systems
PPTX
Características Arquitectónicas.
PDF
Digital Business Architecture
PPTX
caracteristicas arquitectonicas
PDF
Impacto de las TIC\'s en la Cultura de la Mediación a Distancia para la Edu...
PDF
Maken in de Bibliotheek, presentatie bij Platform voor medezeggenschap in de ...
PPTX
Algebra
PPT
Φακέλοι και Επεκτάσεις
DOCX
Impacto de las tics en la educación cecilia ferreyra
PDF
Data Science Popup Austin: Surfing Silver Dynamic Bayesian Forecasting for Fu...
PPTX
India Gadget Expo: Emotion Trumps Gadgets
PPTX
Grammar for beginner level
PDF
La Investigación como Proceso y el Conocimiento Científico - Bloque II
PPT
Understanding Objects
Docker 101: Introduction to Docker
Scaling Community Information Systems
Características Arquitectónicas.
Digital Business Architecture
caracteristicas arquitectonicas
Impacto de las TIC\'s en la Cultura de la Mediación a Distancia para la Edu...
Maken in de Bibliotheek, presentatie bij Platform voor medezeggenschap in de ...
Algebra
Φακέλοι και Επεκτάσεις
Impacto de las tics en la educación cecilia ferreyra
Data Science Popup Austin: Surfing Silver Dynamic Bayesian Forecasting for Fu...
India Gadget Expo: Emotion Trumps Gadgets
Grammar for beginner level
La Investigación como Proceso y el Conocimiento Científico - Bloque II
Understanding Objects
Ad

Similar to Introduction to docker (20)

PDF
Docker, c'est bonheur !
PPTX
Real World Experience of Running Docker in Development and Production
PDF
Docker and friends at Linux Days 2014 in Prague
PPTX
Docker container management
PDF
Perspectives on Docker
PPTX
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
PDF
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
PPTX
Docker practice
ODP
Docker: The basics - Including a demo with an awesome full-stack JS app
PDF
Introduction to Docker and Containers
PDF
Docker and-containers-for-development-and-deployment-scale12x
PDF
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
PDF
Hands-On Session Docker
PDF
Adrian Mouat - Docker Tips and Tricks
PDF
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PDF
A Gentle Introduction to Docker and Containers
PDF
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
PPTX
Running Docker in Development & Production (#ndcoslo 2015)
PDF
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PDF
Challenges of container configuration
Docker, c'est bonheur !
Real World Experience of Running Docker in Development and Production
Docker and friends at Linux Days 2014 in Prague
Docker container management
Perspectives on Docker
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker practice
Docker: The basics - Including a demo with an awesome full-stack JS app
Introduction to Docker and Containers
Docker and-containers-for-development-and-deployment-scale12x
[EXTENDED] Ceph, Docker, Heroku Slugs, CoreOS and Deis Overview
Hands-On Session Docker
Adrian Mouat - Docker Tips and Tricks
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
A Gentle Introduction to Docker and Containers
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Running Docker in Development & Production (#ndcoslo 2015)
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
Challenges of container configuration

Recently uploaded (20)

PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
AI in Product Development-omnex systems
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
medical staffing services at VALiNTRY
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PPTX
Transform Your Business with a Software ERP System
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
L1 - Introduction to python Backend.pptx
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
ManageIQ - Sprint 268 Review - Slide Deck
AI in Product Development-omnex systems
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Operating system designcfffgfgggggggvggggggggg
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PTS Company Brochure 2025 (1).pdf.......
Wondershare Filmora 15 Crack With Activation Key [2025
Odoo POS Development Services by CandidRoot Solutions
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
medical staffing services at VALiNTRY
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Transform Your Business with a Software ERP System
ISO 45001 Occupational Health and Safety Management System
Upgrade and Innovation Strategies for SAP ERP Customers
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Odoo Companies in India – Driving Business Transformation.pdf
L1 - Introduction to python Backend.pptx
How to Choose the Right IT Partner for Your Business in Malaysia

Introduction to docker