SlideShare a Scribd company logo
Docker Paris meetup #1 – 10/02/2013
Victor Vieux, dotCloud Inc.
@vieux
Outline
•  Intro to Docker
•  Installing Docker
•  Basic commands
•  Demo: Simple deployment
•  Questions
Quick survey
•  How many people have heard of Docker
before this Meetup ?
•  How many people have tried Docker ?
•  How many people are using Docker in
production ?
Introduction to Docker
Origins of Docker
•  Docker is a rewrite of similar code that
currently powers the dotCloud PaaS
•  Original version written in Python (like
dotCloud PaaS), now written in Go
•  It’s a young project (~6 months), but with a
huge community.
Docker Timeline
•  January 2013 Docker started as an internal project
inside of dotCloud
•  March 21, 2013 Solomon gives Docker lightning
talk a PyCon US
•  March 27, 2013 Docker 0.1 released to Public
•  September 4, 2013 Docker merged into Openstack
for the Havana release
•  September 19, 2013 Partnership with Red Hat
around OpenShift
•  September 27, 2013 Docker 0.6.3 released
In the first 6 months
•  6000+ Github stars
•  150+ Contributors
•  50,000+ docker index pull
•  100’s of projects built on top of Docker
– UIs (DockerUI, Shipyard, Dockland…)
– Open Source PaaS (DEIS, Flynn, Dokku…)
– Continuous Deployment (Strider…)
•  1700’s Dockerized applications on Github
What is Docker ?
“Docker is an open-source engine to
easily create lightweight, portable,
self-sufficient containers from any
application. The same container that
a developer builds and test on a
laptop can run at scale, in production,
on VMs, OpenStack cluster, public
clouds and more.”
How does Docker work ?
•  LinuX Containers (LXC)
•  Control Groups & Namespaces
•  AUFS
•  Client – Server with an HTTP API
LinuX Containers (LCX)
•  Let’s your run a Linux system within another
Linux system
•  A container is a group of processes on a
Linux box, put together is an isolated
environment
•  From the inside, it looks like a VM
•  From the outside, it looks like normal
processes
•  “chroot on steroids”
Why Containers?
•  Speed: Boots in seconds
•  Footprint: 100-1000 containers on one
machine. Small disk requirements
Containers vs. VMs
Control Groups & Namespaces
Linux kernel feature to limit, account and
isolate resource usage, such as:
– CPU
– Memory
– Disk I/O
AUFS
	
  
•  File system that implements union mount.
	
  
	
  
	
  
•  Supports Copy On Write (COW):
	
  
	
  
	
  
# mount –t aufs –o br=/files1:/files2 none /files
	
  
	
  
	
  
# mount –t aufs –o br=/tmp=rw:/bin=ro none /files
	
  
	
  
Installing Docker
Requirements
•  Linux Kernel 3.8 or above
•  AUFS
•  LXC
•  64-bit
Installations
•  Ubuntu Linux
•  Binaries
•  Using Vagrant
More on: http://docs.docker.io/en/latest/installation
Installation: Ubuntu Linux
•  AUFS support
$> sudo apt-get update
$> sudo apt-get intall linux-image-extra-`uname –r`
•  Add Docker repository
$> sudo sh –c “curl https://get.docker.io/gpg | apt-key add -”
$> sudo sh –c “echo deb http://get.docker.io/ubuntu docker 
main > /etc/apt/sources.list.d/docker.list”
•  Install
$> sudo apt-get update
$> sudo apt-get install lxc-docker
Installation: Binaries
•  Get the docker binary
$> wget –output-document=docker https://get.docker.io/builds/
Linux/x86_64/docker-latest
$> chmod +x docker
•  Run the docker daemon
$> sudo ./docker –d &
•  Use your own system startup script
	
  
Installation: Vagrant
•  Clone the Docker repository
$> git clone https://github.com/dotcloud/docker.git
•  Startup the vagrant image
$> vagrant up
	
  
•  SSH into the image
$> vagrant ssh
•  Docker client works on Mac
Basic	
  commands	
  
Classic: hello world
•  Get one base image (ubuntu, centos, busybox,…)
$> docker pull ubuntu
•  List images on your system
$> docker images
	
  
	
  
•  Print hello world
$> docker run ubuntu:12.10 echo “hello world”
	
  
Detached mode
•  Run	
  in	
  Docker	
  using	
  the	
  detach	
  flag	
  (-­‐d)	
  
$> docker run –d ubuntu sh –c “while true; do echo hello
world; sleep 1; done”
•  Get	
  container’s	
  id	
  
$> docker ps
•  A:ach	
  to	
  the	
  container	
  
$> docker attach <container_id>
	
  
•  Stop/Start/Restart	
  the	
  container	
  
$> docker stop <container_id>
	
  
Containers vs Images
•  Remove a file from an image
$> docker run busybox rm /etc/passwd
•  The file is still there ??
$> docker run busybox cat /etc/passwd
•  Commit the newly created to an image
$> docker ps –n=2 #get the container’s id
$> docker commit <id> vieux/broken-busybox
	
  
•  The file is gone
$> docker run vieux/broken-busybox cat /etc/passwd
Public Index & Network
•  Pull an apache image from the public index
$> docker search apache
$> docker pull creack/apache2
•  Run the image and check the ports
$> docker run –d creack/apache2
$> docker ps
•  Expose public ports
$> docker run –d –p 8888:80 –p 4444:443 creack/apache2
$> docker ps
	
  
Creating your 1st app: the interactive way
•  Using docker in interactive mode
$> docker run –i –t ubuntu bash
root@82c63ee50c3d:/#
root@82c63ee50c3d:/# apt-get update
[…]
root@82c63ee50c3d:/# apt-get install memcached
[…]
root@82c63ee50c3d:/# exit
•  Commit the image
$> docker commit `docker ps –q –l` vieux/memcached
•  Start the image
$> docker run –d –p 11211 –u daemon vieux/memcached memcached
Creating your 1st app: the boring way
•  Multiple run / commit
$> docker run ubuntu apt-get update
$> $ID=(docker commit `docker ps –q –l`)
$> docker run $ID apt-get install memcached
$> docker commit `docker ps –q –l vieux/memcached
•  Define default configuration at commit
$> docker commit –run=‘{“Entrypoint”: [“memcached”]}’ […]
•  Start the image
$> docker run –d –p 11211 –u daemon vieux/memcached
Creating your 1st app: the scripted way
•  Write a Dockerfile
# Memcached
FROM ubuntu
MAINTAINER Victor Vieux <victor@dotcloud.com>
RUN apt-get update
RUN apt-get install –y memcached
ENTRYPOINT [“memcached”]
USER daemon
EXPOSE 11211
•  Buid the image
$> docker build –t=vieux/memcached .
•  Start the image
$> docker run –d vieux/memcached memcached
Volumes and bind mounts
•  Put your persistent data in a volume
$> $ID=(docker run –d –v /var/lib/mysql vieux/mysql)
•  So you can re use it in another container
$> docker run –d –volumes-from=$ID vieux/mysql
	
  
•  Bind mounts
$> docker run –d –v /home/vv:/home <image>
•  Supports read only / read write
$> docker run –d –v host/path:container/path:rw <image>
Other commands
•  docker cp #copy a file from container to host
•  docker diff #print container changes
•  docker top #display running processes inside a container
•  docker rm/rmi #delete container/image
•  docker wait #wait until container stop and print exit code
More on: http://docs.docker.io/en/latest/commandline/cli
Demo:
Simple deployment
Local development
•  App running in prod
http://ks3100989.kimsufi.com:8080/
•  Build local
	
  $> docker build –t=gcm .
•  Test local
$> docker run –p 49200:8080 gcm
	
  http://localhost:49200
•  Change some files
•  Rebuild & test
$> docker build –t=gcm .
$> docker run –p 49200:8080 gcm
Push to prod
•  Tag image in order to push it
$> docker tag gcm ks3100989.kimsufi.com:5000/gcm
•  Push image to local registry
$> docker push ks3100989.kimsufi.com:5000/gcm
•  On production server, download image
$> docker pull ks3100989.kimsufi.com:5000/gcm
•  Restart the container
$> docker stop <container_id>
$> docker run –d –p 8080:8080 <image>
Questions ?
Thank you!
@vieux

More Related Content

PPTX
Introduction to docker and oci
PPTX
Why Docker
PDF
Docker 101: An Introduction
PDF
A la découverte de kubernetes
PDF
Container Network Interface: Network Plugins for Kubernetes and beyond
PDF
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
PPTX
Docker 사내교육 자료
PDF
Docker Introduction
Introduction to docker and oci
Why Docker
Docker 101: An Introduction
A la découverte de kubernetes
Container Network Interface: Network Plugins for Kubernetes and beyond
Introduction to Docker at SF Peninsula Software Development Meetup @Guidewire
Docker 사내교육 자료
Docker Introduction

What's hot (20)

PDF
Docker by Example - Basics
PDF
왕초보를 위한 도커 사용법
PDF
[오픈소스컨설팅]Docker기초 실습 교육 20181113_v3
PDF
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
PDF
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
PDF
Docker multi-stage build
PDF
초심자를 위한 도커 소개 및 입문
PPTX
Docker introduction for the beginners
PDF
Introduction to docker
PPTX
Kubernetes Basics
PDF
kubernetes, pourquoi et comment
PPTX
Docker 基礎介紹與實戰
PDF
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
PDF
Introduction to Docker
PDF
Kubernetes Summit 2023: Head First Kubernetes
PPTX
Docker, LinuX Container
PDF
Alphorm.com Formation Kubernetes : Installation et Configuration
PDF
Spring Boot & Containers - Do's & Don'ts
PPTX
Docker Container Security
Docker by Example - Basics
왕초보를 위한 도커 사용법
[오픈소스컨설팅]Docker기초 실습 교육 20181113_v3
Introduction to Docker and all things containers, Docker Meetup at RelateIQ
Architecture Overview: Kubernetes with Red Hat Enterprise Linux 7.1
Docker multi-stage build
초심자를 위한 도커 소개 및 입문
Docker introduction for the beginners
Introduction to docker
Kubernetes Basics
kubernetes, pourquoi et comment
Docker 基礎介紹與實戰
The Next Generation Firewall for Red Hat Enterprise Linux 7 RC
Introduction to Docker
Kubernetes Summit 2023: Head First Kubernetes
Docker, LinuX Container
Alphorm.com Formation Kubernetes : Installation et Configuration
Spring Boot & Containers - Do's & Don'ts
Docker Container Security
Ad

Viewers also liked (20)

PPTX
Docker introduction
PDF
Docker 101: Introduction to Docker
PPTX
Docker presentation
PPTX
On the use of radio resource tests in wireless ad hoc networks
PPTX
Offnet- Offline Mobile Application
PDF
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
PPTX
Leveraging Honest Users: Stealth Command-and-Control of Botnets
PDF
PhD Thesis Diogo Mónica
PDF
An IDS for browser hijacking
PPTX
WiFiHop - mitigating the Evil twin attack through multi-hop detection
KEY
ZFS Tutorial LISA 2011
PPTX
Observable Non-Sybil Quorums Construction in One-Hop Wireless Ad Hoc Networks
PDF
Secure Software Distribution in an Adversarial World
PDF
MultiPath TCP - The path to multipath
PDF
ESORICS 2014: Local Password validation using Self-Organizing Maps
PPTX
HAProxy
PPTX
DockerCon Keynote Ben Golub
PDF
MTLS in a Microservices World
PPTX
MicroServices on Azure
PDF
Decomposing applications for deployability and scalability #springone2gx #s12gx
Docker introduction
Docker 101: Introduction to Docker
Docker presentation
On the use of radio resource tests in wireless ad hoc networks
Offnet- Offline Mobile Application
From 0 to 0xdeadbeef - security mistakes that will haunt your startup
Leveraging Honest Users: Stealth Command-and-Control of Botnets
PhD Thesis Diogo Mónica
An IDS for browser hijacking
WiFiHop - mitigating the Evil twin attack through multi-hop detection
ZFS Tutorial LISA 2011
Observable Non-Sybil Quorums Construction in One-Hop Wireless Ad Hoc Networks
Secure Software Distribution in an Adversarial World
MultiPath TCP - The path to multipath
ESORICS 2014: Local Password validation using Self-Organizing Maps
HAProxy
DockerCon Keynote Ben Golub
MTLS in a Microservices World
MicroServices on Azure
Decomposing applications for deployability and scalability #springone2gx #s12gx
Ad

Similar to Docker presentation | Paris Docker Meetup (20)

PDF
Running the Oracle SOA Suite Environment in a Docker Container
PPTX
Docker workshop
PDF
Introduction to Docker
PPTX
Tech talk on docker with demo
PDF
1 docker first_linux_container_hands_on
 
PDF
Docker, but what it is?
PDF
Docker from A to Z, including Swarm and OCCS
PDF
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
PDF
Docker at Djangocon 2013 | Talk by Ken Cochrane
PDF
Django and Docker
PDF
Introduction To Docker
PPTX
Docker presentation
PDF
Docker From Scratch
PPTX
PPTX
Docker for the new Era: Introducing Docker,its components and tools
PPTX
Docker Ecosystem on Azure
PPTX
Docker and the Container Ecosystem
PDF
Docker for mere mortals
PDF
Using Docker with OpenStack - Hands On!
Running the Oracle SOA Suite Environment in a Docker Container
Docker workshop
Introduction to Docker
Tech talk on docker with demo
1 docker first_linux_container_hands_on
 
Docker, but what it is?
Docker from A to Z, including Swarm and OCCS
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
Docker at Djangocon 2013 | Talk by Ken Cochrane
Django and Docker
Introduction To Docker
Docker presentation
Docker From Scratch
Docker for the new Era: Introducing Docker,its components and tools
Docker Ecosystem on Azure
Docker and the Container Ecosystem
Docker for mere mortals
Using Docker with OpenStack - Hands On!

More from dotCloud (20)

PPTX
Immutable infrastructure with Docker and EC2
PDF
Docker at Spotify - Dockercon14
PPTX
John Engates Keynote at Dockercon 14
PDF
Building a smarter application Stack by Tomas Doran from Yelp
PDF
Are VM Passé?
PDF
OpenStack - Docker - Rackspace HQ
PDF
Docker in pratice -chenyifei
PDF
Wot2013云计算架构师峰会 -陈轶飞2
PDF
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
PPTX
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
PPTX
Dockerizing stashboard - Docker meetup at Twilio
PPTX
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
PDF
Dockerizing your applications - Docker workshop @Twitter
PDF
Introduction to Docker - Docker workshop @Twitter
PDF
Docker worshop @Twitter - How to use your own private registry
PDF
Docker links | Docker workshop #2 at Twitter
PPTX
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
PPTX
Intro Docker october 2013
PDF
[Open stack] heat + docker
PPTX
Dockerizing WordPress
Immutable infrastructure with Docker and EC2
Docker at Spotify - Dockercon14
John Engates Keynote at Dockercon 14
Building a smarter application Stack by Tomas Doran from Yelp
Are VM Passé?
OpenStack - Docker - Rackspace HQ
Docker in pratice -chenyifei
Wot2013云计算架构师峰会 -陈轶飞2
Deploying containers and managing them on multiple Docker hosts, Docker Meetu...
Introduction to dockerfile, SF Peninsula Software Development Meetup @Guidewire
Dockerizing stashboard - Docker meetup at Twilio
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Dockerizing your applications - Docker workshop @Twitter
Introduction to Docker - Docker workshop @Twitter
Docker worshop @Twitter - How to use your own private registry
Docker links | Docker workshop #2 at Twitter
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Intro Docker october 2013
[Open stack] heat + docker
Dockerizing WordPress

Recently uploaded (20)

PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
A Presentation on Artificial Intelligence
PDF
Encapsulation theory and applications.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Empathic Computing: Creating Shared Understanding
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
A Presentation on Artificial Intelligence
Encapsulation theory and applications.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Docker presentation | Paris Docker Meetup

  • 1. Docker Paris meetup #1 – 10/02/2013 Victor Vieux, dotCloud Inc. @vieux
  • 2. Outline •  Intro to Docker •  Installing Docker •  Basic commands •  Demo: Simple deployment •  Questions
  • 3. Quick survey •  How many people have heard of Docker before this Meetup ? •  How many people have tried Docker ? •  How many people are using Docker in production ?
  • 5. Origins of Docker •  Docker is a rewrite of similar code that currently powers the dotCloud PaaS •  Original version written in Python (like dotCloud PaaS), now written in Go •  It’s a young project (~6 months), but with a huge community.
  • 6. Docker Timeline •  January 2013 Docker started as an internal project inside of dotCloud •  March 21, 2013 Solomon gives Docker lightning talk a PyCon US •  March 27, 2013 Docker 0.1 released to Public •  September 4, 2013 Docker merged into Openstack for the Havana release •  September 19, 2013 Partnership with Red Hat around OpenShift •  September 27, 2013 Docker 0.6.3 released
  • 7. In the first 6 months •  6000+ Github stars •  150+ Contributors •  50,000+ docker index pull •  100’s of projects built on top of Docker – UIs (DockerUI, Shipyard, Dockland…) – Open Source PaaS (DEIS, Flynn, Dokku…) – Continuous Deployment (Strider…) •  1700’s Dockerized applications on Github
  • 8. What is Docker ? “Docker is an open-source engine to easily create lightweight, portable, self-sufficient containers from any application. The same container that a developer builds and test on a laptop can run at scale, in production, on VMs, OpenStack cluster, public clouds and more.”
  • 9. How does Docker work ? •  LinuX Containers (LXC) •  Control Groups & Namespaces •  AUFS •  Client – Server with an HTTP API
  • 10. LinuX Containers (LCX) •  Let’s your run a Linux system within another Linux system •  A container is a group of processes on a Linux box, put together is an isolated environment •  From the inside, it looks like a VM •  From the outside, it looks like normal processes •  “chroot on steroids”
  • 11. Why Containers? •  Speed: Boots in seconds •  Footprint: 100-1000 containers on one machine. Small disk requirements
  • 13. Control Groups & Namespaces Linux kernel feature to limit, account and isolate resource usage, such as: – CPU – Memory – Disk I/O
  • 14. AUFS   •  File system that implements union mount.       •  Supports Copy On Write (COW):       # mount –t aufs –o br=/files1:/files2 none /files       # mount –t aufs –o br=/tmp=rw:/bin=ro none /files    
  • 16. Requirements •  Linux Kernel 3.8 or above •  AUFS •  LXC •  64-bit
  • 17. Installations •  Ubuntu Linux •  Binaries •  Using Vagrant More on: http://docs.docker.io/en/latest/installation
  • 18. Installation: Ubuntu Linux •  AUFS support $> sudo apt-get update $> sudo apt-get intall linux-image-extra-`uname –r` •  Add Docker repository $> sudo sh –c “curl https://get.docker.io/gpg | apt-key add -” $> sudo sh –c “echo deb http://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list” •  Install $> sudo apt-get update $> sudo apt-get install lxc-docker
  • 19. Installation: Binaries •  Get the docker binary $> wget –output-document=docker https://get.docker.io/builds/ Linux/x86_64/docker-latest $> chmod +x docker •  Run the docker daemon $> sudo ./docker –d & •  Use your own system startup script  
  • 20. Installation: Vagrant •  Clone the Docker repository $> git clone https://github.com/dotcloud/docker.git •  Startup the vagrant image $> vagrant up   •  SSH into the image $> vagrant ssh •  Docker client works on Mac
  • 22. Classic: hello world •  Get one base image (ubuntu, centos, busybox,…) $> docker pull ubuntu •  List images on your system $> docker images     •  Print hello world $> docker run ubuntu:12.10 echo “hello world”  
  • 23. Detached mode •  Run  in  Docker  using  the  detach  flag  (-­‐d)   $> docker run –d ubuntu sh –c “while true; do echo hello world; sleep 1; done” •  Get  container’s  id   $> docker ps •  A:ach  to  the  container   $> docker attach <container_id>   •  Stop/Start/Restart  the  container   $> docker stop <container_id>  
  • 24. Containers vs Images •  Remove a file from an image $> docker run busybox rm /etc/passwd •  The file is still there ?? $> docker run busybox cat /etc/passwd •  Commit the newly created to an image $> docker ps –n=2 #get the container’s id $> docker commit <id> vieux/broken-busybox   •  The file is gone $> docker run vieux/broken-busybox cat /etc/passwd
  • 25. Public Index & Network •  Pull an apache image from the public index $> docker search apache $> docker pull creack/apache2 •  Run the image and check the ports $> docker run –d creack/apache2 $> docker ps •  Expose public ports $> docker run –d –p 8888:80 –p 4444:443 creack/apache2 $> docker ps  
  • 26. Creating your 1st app: the interactive way •  Using docker in interactive mode $> docker run –i –t ubuntu bash root@82c63ee50c3d:/# root@82c63ee50c3d:/# apt-get update […] root@82c63ee50c3d:/# apt-get install memcached […] root@82c63ee50c3d:/# exit •  Commit the image $> docker commit `docker ps –q –l` vieux/memcached •  Start the image $> docker run –d –p 11211 –u daemon vieux/memcached memcached
  • 27. Creating your 1st app: the boring way •  Multiple run / commit $> docker run ubuntu apt-get update $> $ID=(docker commit `docker ps –q –l`) $> docker run $ID apt-get install memcached $> docker commit `docker ps –q –l vieux/memcached •  Define default configuration at commit $> docker commit –run=‘{“Entrypoint”: [“memcached”]}’ […] •  Start the image $> docker run –d –p 11211 –u daemon vieux/memcached
  • 28. Creating your 1st app: the scripted way •  Write a Dockerfile # Memcached FROM ubuntu MAINTAINER Victor Vieux <victor@dotcloud.com> RUN apt-get update RUN apt-get install –y memcached ENTRYPOINT [“memcached”] USER daemon EXPOSE 11211 •  Buid the image $> docker build –t=vieux/memcached . •  Start the image $> docker run –d vieux/memcached memcached
  • 29. Volumes and bind mounts •  Put your persistent data in a volume $> $ID=(docker run –d –v /var/lib/mysql vieux/mysql) •  So you can re use it in another container $> docker run –d –volumes-from=$ID vieux/mysql   •  Bind mounts $> docker run –d –v /home/vv:/home <image> •  Supports read only / read write $> docker run –d –v host/path:container/path:rw <image>
  • 30. Other commands •  docker cp #copy a file from container to host •  docker diff #print container changes •  docker top #display running processes inside a container •  docker rm/rmi #delete container/image •  docker wait #wait until container stop and print exit code More on: http://docs.docker.io/en/latest/commandline/cli
  • 32. Local development •  App running in prod http://ks3100989.kimsufi.com:8080/ •  Build local  $> docker build –t=gcm . •  Test local $> docker run –p 49200:8080 gcm  http://localhost:49200 •  Change some files •  Rebuild & test $> docker build –t=gcm . $> docker run –p 49200:8080 gcm
  • 33. Push to prod •  Tag image in order to push it $> docker tag gcm ks3100989.kimsufi.com:5000/gcm •  Push image to local registry $> docker push ks3100989.kimsufi.com:5000/gcm •  On production server, download image $> docker pull ks3100989.kimsufi.com:5000/gcm •  Restart the container $> docker stop <container_id> $> docker run –d –p 8080:8080 <image>