SlideShare a Scribd company logo
Docker - Lightweight Virtualization
Why?
That eternal crap…!
(i.e Having no idea what’s wrong)
Passing on the headache!
Not the solution
Some use cases
• Solving dependency hell
• Configure once, run anywhere
• Continuous integration
• Create sandboxed app
• Run your own PaaS
So, what’s Docker
anyway?
Isolation Portability
Provisioning
Hypervisors/VM
Chef, Puppet, Ansible
Your app, libraries
Docker
Docker vs. VM
Hardware
Linux/Kernel
Container Container
Container Container
Container Container
Hardware
Linux/Kernel
VM
Linux/Kernel
VM
Linux/Kernel
VM
Linux/Kernel
VM
Linux/Kernel
Shared Resource, Lightweight,
Portable, Fast to boot
Dedicated Resource, Heavy, Not
portable, Comparatively slower boot
Under the Hood
LXC
Dream inside dream
inside dream….
(The Inception in Linux)
Namespaces
& cgroups
Isolated pid, net, uid….
Copy-on-
write
Filesystem
AUFS, btrfs, ZFS….
Installation
Do It Yourself
Docker Vocabulary
• Repository
• Image
• Tag
$ docker images ubuntu
REPOSITORY TAG IMAGE ID
ubuntu 10.04 9cc9ea5ea540
ubuntu 12.04 9cd978db300e
ubuntu 12.10 5ac751e8d623
ubuntu 13.04 eb601b8965b8
ubuntu 13.10 9f676bd305a4
ubuntu latest 9cd978db300e
ubuntu lucid 9cc9ea5ea540
ubuntu precise 9cd978db300e
ubuntu quantal 5ac751e8d623
ubuntu raring eb601b8965b8
ubuntu saucy 9f676bd305a4
Docker Vocabulary
• Registry $ docker pull ubuntu:12.04
Pulling repository ubuntu
c0fe63f9a4c1: Pulling dependent layers
511136ea3c5a: Download complete
6170bb7b0ad1: Download complete
79fdb1362c84: Downloading [===> ]56 MB/66.64 MB 10m9s
Docker Vocabulary
• Index $ docker login
Username: mehdi
Password:
Email: mehdi@team.okdo.it
Login Succeeded
Docker Vocabulary
• Container
$ docker run ubuntu:12.04 echo Hello World
Hello World
$ docker run -i -t ubuntu:12.04 /bin/bash
root@a09d485c9a9f:/# uname -a
Linux a09d485c9a9f 3.13.3-tinycore64 #1 SMP Wed
Mar 26 03:16:13 UTC 2014 x86_64 x86_64 x86_64
GNU/Linux
!
root@a09d485c9a9f:/#
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS !
f0638f0a1c7a ubuntu:12.04 /bin/bash 46 minutes ago Up 4 seconds
Tip: Press Ctrl+P
and Ctrl+Q to
detach running
containers
Docker Vocabulary
• Dockerfile $ cat Dockerfile
FROM ubuntu:12.04!
!
MAINTAINER Mehdi Hasan "mehdi@team.okdo.it"!
!
RUN apt-get -y install python-software-properties!
RUN add-apt-repository ppa:chris-lea/node.js!
RUN apt-get update!
RUN apt-get -y install python g++ make nodejs!
$ docker build -t mehdi/nodejs .
There is a
trailing dot
$ docker push mehdi/nodejs
Image c0fe63f9a4c1 already pushed, skipping
Image 5ff6986cd174 already pushed, skipping
Image 3867fae91348 already pushed, skipping
Image 4574f80c91e4 already pushed, skipping
Image 37c2cc34fa4e already pushed, skipping
757db77867dd: Image successfully pushed
Pushing tag for rev [757db77867dd] on {https://
registry-1.docker.io/v1/repositories/mehdi/nodejs/tags/
latest}
Any idea
why these
images are
skipped?
Container vs. Image!
Still Puzzled?
Running container from an image:
Creating image from a container:
$ docker ps -a!
$ docker commit -m “Image description"
<CONTAINER_ID> <USERNAME>/<REPO>
$ docker run -i -t ubuntu:12.04 /bin/bash
Lets see a Demo
Docker Workflow
Dev ProdRegistry
Public/Private
Demo
Deploying a sample app on the cloud using Docker
Your Next Weekend Fun Project:
Deploy something with Dokku
Dokku
Docker powered mini-Heroku in around 100 lines of Bash
See the demo here: http://vimeo.com/68631325
https://github.com/progrium/dokku
The rabbit hole goes deeper
than that…
• How to deal with data, logs, file uploads? Where to store?
Inside container? Inside host? Inside another container?



Hint: Read http://docs.docker.io/en/latest/use/
working_with_volumes/
• How to deal with distributed systems? 



Hint: Follow http://www.centurylinklabs.com/category/
docker-posts/
Keep following…
• https://coreos.com/
• http://www.confd.io/
• http://www.serfdom.io/
• http://www.dockerbook.com/ (Not yet released)*
* As of May, 2014
Docker cheat sheet
• https://gist.github.com/wsargent/7049221
• https://coderwall.com/p/2es5jw
Questions?

More Related Content

PDF
Docker and Puppet — Puppet Camp L.A. — SCALE12X
PDF
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
PDF
Solving Real World Production Problems with Docker
PDF
Docker Tips And Tricks at the Docker Beijing Meetup
PDF
Using docker to develop NAS applications
PDF
Develop QNAP NAS App by Docker
PDF
Using Docker in the Real World
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Solving Real World Production Problems with Docker
Docker Tips And Tricks at the Docker Beijing Meetup
Using docker to develop NAS applications
Develop QNAP NAS App by Docker
Using Docker in the Real World
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ

What's hot (20)

PDF
Microservices. Microservices everywhere! (At OSCON 2015)
PDF
From development environments to production deployments with Docker, Compose,...
PDF
Perspectives on Docker
PDF
Docker 初探,實驗室中的運貨鯨
PPTX
Azure container service docker-ha noi com
PDF
A Hands-on Introduction to Docker
PDF
Docker 原理與實作
PDF
Docker by Example - Basics
PPTX
The challenge of application distribution - Introduction to Docker (2014 dec ...
PDF
Docker by Example - Quiz
PPTX
QNAP COSCUP Container Station
PPTX
First steps to docker
PDF
Real-World Docker: 10 Things We've Learned
PDF
Docker 101 @KACST Saudi HPC 2016
PPTX
Learn docker in 90 minutes
PDF
Docker in production: reality, not hype (OSCON 2015)
PDF
Docker Security: Are Your Containers Tightly Secured to the Ship?
PDF
Docker composeで開発環境をメンバに配布せよ
PDF
Puppet and Vagrant in development
PDF
Docker and Containers for Development and Deployment — SCALE12X
Microservices. Microservices everywhere! (At OSCON 2015)
From development environments to production deployments with Docker, Compose,...
Perspectives on Docker
Docker 初探,實驗室中的運貨鯨
Azure container service docker-ha noi com
A Hands-on Introduction to Docker
Docker 原理與實作
Docker by Example - Basics
The challenge of application distribution - Introduction to Docker (2014 dec ...
Docker by Example - Quiz
QNAP COSCUP Container Station
First steps to docker
Real-World Docker: 10 Things We've Learned
Docker 101 @KACST Saudi HPC 2016
Learn docker in 90 minutes
Docker in production: reality, not hype (OSCON 2015)
Docker Security: Are Your Containers Tightly Secured to the Ship?
Docker composeで開発環境をメンバに配布せよ
Puppet and Vagrant in development
Docker and Containers for Development and Deployment — SCALE12X
Ad

Similar to Docker - Lightweight Virtualization (20)

PPTX
Docker and the Container Ecosystem
PDF
Docker
PPTX
Docker Starter Pack
PDF
Docker by Example - Basics
PPTX
Docker 101
PDF
Introduction To Docker
PPTX
Primi passi con Docker - ItalianCoders - 12-01-2021
PPTX
PDF
Running the Oracle SOA Suite Environment in a Docker Container
PDF
Introduction to docker
PDF
Docker presentation | Paris Docker Meetup
PDF
Victor Vieux at Docker Paris Meetup #1
PDF
Présentation de Docker
PDF
Docker Intro
PDF
DCA. certificate slide Session 2
PDF
Docker basics
PDF
Docker as an every day work tool
PDF
Docker Birtday #5
PDF
Docker how to
PPTX
Docker
Docker and the Container Ecosystem
Docker
Docker Starter Pack
Docker by Example - Basics
Docker 101
Introduction To Docker
Primi passi con Docker - ItalianCoders - 12-01-2021
Running the Oracle SOA Suite Environment in a Docker Container
Introduction to docker
Docker presentation | Paris Docker Meetup
Victor Vieux at Docker Paris Meetup #1
Présentation de Docker
Docker Intro
DCA. certificate slide Session 2
Docker basics
Docker as an every day work tool
Docker Birtday #5
Docker how to
Docker
Ad

Recently uploaded (20)

PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Encapsulation theory and applications.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
KodekX | Application Modernization Development
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Diabetes mellitus diagnosis method based random forest with bat algorithm
Encapsulation theory and applications.pdf
The AUB Centre for AI in Media Proposal.docx
KodekX | Application Modernization Development
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Spectroscopy.pptx food analysis technology
MIND Revenue Release Quarter 2 2025 Press Release
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Programs and apps: productivity, graphics, security and other tools
sap open course for s4hana steps from ECC to s4
Advanced methodologies resolving dimensionality complications for autism neur...

Docker - Lightweight Virtualization

  • 3. That eternal crap…! (i.e Having no idea what’s wrong)
  • 4. Passing on the headache! Not the solution
  • 5. Some use cases • Solving dependency hell • Configure once, run anywhere • Continuous integration • Create sandboxed app • Run your own PaaS
  • 8. Docker vs. VM Hardware Linux/Kernel Container Container Container Container Container Container Hardware Linux/Kernel VM Linux/Kernel VM Linux/Kernel VM Linux/Kernel VM Linux/Kernel Shared Resource, Lightweight, Portable, Fast to boot Dedicated Resource, Heavy, Not portable, Comparatively slower boot
  • 9. Under the Hood LXC Dream inside dream inside dream…. (The Inception in Linux) Namespaces & cgroups Isolated pid, net, uid…. Copy-on- write Filesystem AUFS, btrfs, ZFS….
  • 11. Docker Vocabulary • Repository • Image • Tag $ docker images ubuntu REPOSITORY TAG IMAGE ID ubuntu 10.04 9cc9ea5ea540 ubuntu 12.04 9cd978db300e ubuntu 12.10 5ac751e8d623 ubuntu 13.04 eb601b8965b8 ubuntu 13.10 9f676bd305a4 ubuntu latest 9cd978db300e ubuntu lucid 9cc9ea5ea540 ubuntu precise 9cd978db300e ubuntu quantal 5ac751e8d623 ubuntu raring eb601b8965b8 ubuntu saucy 9f676bd305a4
  • 12. Docker Vocabulary • Registry $ docker pull ubuntu:12.04 Pulling repository ubuntu c0fe63f9a4c1: Pulling dependent layers 511136ea3c5a: Download complete 6170bb7b0ad1: Download complete 79fdb1362c84: Downloading [===> ]56 MB/66.64 MB 10m9s
  • 13. Docker Vocabulary • Index $ docker login Username: mehdi Password: Email: mehdi@team.okdo.it Login Succeeded
  • 14. Docker Vocabulary • Container $ docker run ubuntu:12.04 echo Hello World Hello World $ docker run -i -t ubuntu:12.04 /bin/bash root@a09d485c9a9f:/# uname -a Linux a09d485c9a9f 3.13.3-tinycore64 #1 SMP Wed Mar 26 03:16:13 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux ! root@a09d485c9a9f:/# $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS ! f0638f0a1c7a ubuntu:12.04 /bin/bash 46 minutes ago Up 4 seconds Tip: Press Ctrl+P and Ctrl+Q to detach running containers
  • 15. Docker Vocabulary • Dockerfile $ cat Dockerfile FROM ubuntu:12.04! ! MAINTAINER Mehdi Hasan "mehdi@team.okdo.it"! ! RUN apt-get -y install python-software-properties! RUN add-apt-repository ppa:chris-lea/node.js! RUN apt-get update! RUN apt-get -y install python g++ make nodejs! $ docker build -t mehdi/nodejs . There is a trailing dot $ docker push mehdi/nodejs Image c0fe63f9a4c1 already pushed, skipping Image 5ff6986cd174 already pushed, skipping Image 3867fae91348 already pushed, skipping Image 4574f80c91e4 already pushed, skipping Image 37c2cc34fa4e already pushed, skipping 757db77867dd: Image successfully pushed Pushing tag for rev [757db77867dd] on {https:// registry-1.docker.io/v1/repositories/mehdi/nodejs/tags/ latest} Any idea why these images are skipped?
  • 16. Container vs. Image! Still Puzzled? Running container from an image: Creating image from a container: $ docker ps -a! $ docker commit -m “Image description" <CONTAINER_ID> <USERNAME>/<REPO> $ docker run -i -t ubuntu:12.04 /bin/bash Lets see a Demo
  • 18. Demo Deploying a sample app on the cloud using Docker
  • 19. Your Next Weekend Fun Project: Deploy something with Dokku Dokku Docker powered mini-Heroku in around 100 lines of Bash See the demo here: http://vimeo.com/68631325 https://github.com/progrium/dokku
  • 20. The rabbit hole goes deeper than that… • How to deal with data, logs, file uploads? Where to store? Inside container? Inside host? Inside another container?
 
 Hint: Read http://docs.docker.io/en/latest/use/ working_with_volumes/ • How to deal with distributed systems? 
 
 Hint: Follow http://www.centurylinklabs.com/category/ docker-posts/
  • 21. Keep following… • https://coreos.com/ • http://www.confd.io/ • http://www.serfdom.io/ • http://www.dockerbook.com/ (Not yet released)* * As of May, 2014
  • 22. Docker cheat sheet • https://gist.github.com/wsargent/7049221 • https://coderwall.com/p/2es5jw