SlideShare a Scribd company logo
Introduce to
Outline
What is docker?
Why docker?
Dockerfile
What is docker?
An open platform for developing,
shipping, and running applications
What it want to solve?
The matrix from hell
“You've got all types of servers, all types of
different languages and frameworks, and all
types of application versions to try and
maintain across those platforms”

- Ben Golub, CEO of Docker
The matrix from hell
We need a container
The matrix from hell
The matrix from hell
Installation
From ubuntu mainstream
Docker goes into Ubuntu mainstream
since 14.04
Currently, v0.9
apt-get install docker.io
From Official Repo
The latest version: v1.0
echo deb https://get.docker.io/ubuntu docker main > /
etc/apt/sources.list.d/docker.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80
--recv-keys
36A1D7869245C8950F966E92D8576A8BA88D21E9
apt-get update
apt-get install lxc-docker
Why Docker?
Fast and less overhead
Image versioning
Portable
Fast and less overhead
VM v.s. Docker
VM v.s. Docker
Server
Host OS
VM v.s. Docker
Server
Host OS
Hypervisor
VM v.s. Docker
Server
Host OS
VM VM
Hypervisor
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Docker Engine
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
Image1
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
Image1
Image2
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
Image1
App1
Image2
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
Image1
App1
Image2
App2
VM v.s. Docker
Server
Host OS
VM VM
Guest OS
Hypervisor
Dep.
App
Server
Host OS
Container Container
Docker Engine
Image1
App1
Image2
App2
App3
Live Demo
IP: 10.10.100.108
Username: test
Password: 123456
docker pull
Download image from Docker Hub
docker pull [image]
Ex: docker pull debian
docker run (1)
docker run [image] [command]
-i interactive mode
-t pseudo-tty
Ex: docker -i -t run debian /bin/bash
Image versioning
Image v.s. Container
Base on LXC and AUFS
Images are read-only
Read / write on container
Files in container won’t keep 

unless you commit
Image v.s. Container
Base on LXC and AUFS
Images are read-only
Read and write on container
Files in container won’t keep 

unless you commit
Image v.s. Container
docker pull debian
Image v.s. Container
docker pull debian
docker run debian /bin/bash
docker commit
docker commit [Container ID] [image
name]
docker commit 1c1f5 new_image
Image v.s. Container
docker pull debian
docker run debian /bin/bash
Image v.s. Container
docker pull debian
docker commit
docker commit
docker run debian /bin/bash
Image v.s. Container
docker pull debian
docker commit
docker commit
docker run debian /bin/bash
Portable
Runs on all major Linux distributions
Boot2docker for Mac and Windows users
A ~25 MB tiny VM inside
Ship your container
There are three ways to ship your
container:
Docker Hub (docker push)
docker save
docker export
docker save / load
This packing will preserve the history of a
docker
docker save [Image Name] > [Archive
Name]
docker load < [Archive Name]
docker export / import
This way only keep the difference
docker export [Container ID] > [Archive
Name]
cat [Archive Name] | docker import -
[Image Name[:Tag]]
Separation of Data and
App
docker run (2)
-v [host directory]:[container directory]

Bind mount a volume
-p [host port]:[container port]

Publish a container's port to the host
Other useful command
docker ps
docker images
docker kill
docker rm
docker rmi
docker logs
docker inspect
Dockerfile
Syntax
FROM
RUN
ENV
ADD
VOLUME
EXPOSE
CMD
Example
docker build
docker build -t [Image Name[:Tag]]

<path to Dockerfile>
docker build -t my_image:v1 .
Build once, run
anywhere
Examples
My Concern
Easy to setup over a VM
Separate data and application
Reproduce my environment fast
Jenkins
Initialize shared volume before service
start
Use supervisor to manage multiple
services
One-time script
Can not use upstart
Use supervisor
Summarize
Do one thing at a time
Treat a docker container as an app
Ecosystem
CoreOS - Work with SystemD
Openstack - An instance type
Docker Hub (Docker Index)
Many providers

- Digital Ocean, EC2, Linode, Google
Cloud Platform
Gotcha
Don’t have its /sbin/init (Issue 1024)
Share kernel, can not run different Linux
Kernel at a time
Use --privileged if needed
Not mentioned
Link to another container
Use share volume on another container
Q & A

More Related Content

ODP
Ruby and Docker on Rails
PDF
Docker with openstack
PDF
Docker Introduction
PPT
Docker introduction
PDF
Intro To Docker
PDF
docker installation and basics
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
PDF
Docker - introduction
Ruby and Docker on Rails
Docker with openstack
Docker Introduction
Docker introduction
Intro To Docker
docker installation and basics
Architecting .NET Applications for Docker and Container Based Deployments
Docker - introduction

What's hot (20)

PDF
PPTX
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
PPTX
Docker intro
PPTX
Docker Basics
PDF
Docker and the Linux Kernel
PDF
Docker 101 - Intro to Docker
PDF
Docker Introduction
PPTX
Docker - 15 great Tutorials
PPTX
Intro- Docker Native for OSX and Windows
PDF
Virtual Machines and Docker
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PDF
DCA. certificate slide Session 1
PDF
Wso2 con 2014-us-tutorial-apache stratos-wso2 private paas with docker integr...
PDF
Docker Introduction
PDF
Visualising Basic Concepts of Docker
PPTX
Start your adventure with docker
PDF
Docker 101 - Getting started
PPTX
Docker introduction
PPTX
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
ODP
Docker - The Linux Container
Docker Understanding, What is Docker? Why Docker? How do I containerize somet...
Docker intro
Docker Basics
Docker and the Linux Kernel
Docker 101 - Intro to Docker
Docker Introduction
Docker - 15 great Tutorials
Intro- Docker Native for OSX and Windows
Virtual Machines and Docker
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
DCA. certificate slide Session 1
Wso2 con 2014-us-tutorial-apache stratos-wso2 private paas with docker integr...
Docker Introduction
Visualising Basic Concepts of Docker
Start your adventure with docker
Docker 101 - Getting started
Docker introduction
Docker Compose | Docker Compose Tutorial | Docker Tutorial For Beginners | De...
Docker - The Linux Container
Ad

Viewers also liked (20)

PPTX
Docker & aPaaS: Enterprise Innovation and Trends for 2015
PDF
Criação de ambientes em chroot
PDF
Namespace
ODP
chroot and SELinux
ODP
LSA2 - 02 chrooting
PDF
Chw00t: Breaking unices’ chroot solutions
PDF
LXD: The hypervisor that isn't
PDF
Understand how docker works
PPTX
Hypervisor "versus" Linux Containers with Docker !
ODP
LSA2 - 01 Virtualization with KVM
PDF
Evoluation of Linux Container Virtualization
PDF
Evolution of Linux Containerization
PDF
Lxd the proper way of runing containers
PDF
LXD Container Hypervisor
PPTX
Performance comparison between Linux Containers and Virtual Machines
PPTX
Containers and Cloud: From LXC to Docker to Kubernetes
PDF
Kubernetes Basics
PDF
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
PDF
An Introduction to Kubernetes
PDF
簡介 Linux 的 Network Namespace 功能
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Criação de ambientes em chroot
Namespace
chroot and SELinux
LSA2 - 02 chrooting
Chw00t: Breaking unices’ chroot solutions
LXD: The hypervisor that isn't
Understand how docker works
Hypervisor "versus" Linux Containers with Docker !
LSA2 - 01 Virtualization with KVM
Evoluation of Linux Container Virtualization
Evolution of Linux Containerization
Lxd the proper way of runing containers
LXD Container Hypervisor
Performance comparison between Linux Containers and Virtual Machines
Containers and Cloud: From LXC to Docker to Kubernetes
Kubernetes Basics
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
An Introduction to Kubernetes
簡介 Linux 的 Network Namespace 功能
Ad

Similar to Introduction to docker (20)

PDF
Introduction to Docker - Learning containerization XP conference 2016
PPTX
Docker and the Container Ecosystem
PPTX
Primi passi con Docker - ItalianCoders - 12-01-2021
PDF
Docker
PDF
codemotion-docker-2014
PDF
Docker, but what it is?
PPTX
Docker Starter Pack
PDF
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
PPTX
Novices guide to docker
PPTX
Docker 101
PDF
docker.pdf
PDF
Introduction to docker
PPTX
Docker Introductory workshop
PDF
A Gentle Introduction to Docker and Containers
PPTX
Docker intro
PDF
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
PDF
Docker - Lightweight Virtualization
PDF
Introduction to Docker - VIT Campus
PDF
Docker by Example - Basics
Introduction to Docker - Learning containerization XP conference 2016
Docker and the Container Ecosystem
Primi passi con Docker - ItalianCoders - 12-01-2021
Docker
codemotion-docker-2014
Docker, but what it is?
Docker Starter Pack
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Novices guide to docker
Docker 101
docker.pdf
Introduction to docker
Docker Introductory workshop
A Gentle Introduction to Docker and Containers
Docker intro
Docker Intro at the Google Developer Group and Google Cloud Platform Meet Up
Docker - Lightweight Virtualization
Introduction to Docker - VIT Campus
Docker by Example - Basics

More from Jim Yeh (6)

PDF
Write FB Bot in Python3
PDF
Introduction openstack horizon
PDF
Web develop in flask
PDF
Git tutorial II
PDF
Git Tutorial I
PDF
Dive into Python Class
Write FB Bot in Python3
Introduction openstack horizon
Web develop in flask
Git tutorial II
Git Tutorial I
Dive into Python Class

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation theory and applications.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
cuic standard and advanced reporting.pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Machine learning based COVID-19 study performance prediction
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation theory and applications.pdf
Modernizing your data center with Dell and AMD
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
cuic standard and advanced reporting.pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Diabetes mellitus diagnosis method based random forest with bat algorithm
NewMind AI Monthly Chronicles - July 2025
Machine learning based COVID-19 study performance prediction
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf
Approach and Philosophy of On baking technology

Introduction to docker