Docker 
Charles Anderson 
Hack Salem - November 2014
What is Docker? 
• An open platform for developing, 
shipping, and running applications 
• Linux-based 
• Why? Speed - ship code faster, 
including test and deployment 
• A solution to “works on my machine” 
Not!
One Word: Containers!
Containers 
• Containers are a lightweight 
virtualization technology 
• User-mode virtualization - not 
hardware virtualization 
• Benefits: density, speed, portability 
• Not new, and Docker isn’t the first
Peace, Love and 
Understanding 
• Devs and ops working 
together with a 
common tool 
• “The real value of 
Docker is not 
technology. It’s getting 
people to agree on 
something.” - Solomon 
Hykes, CTO Docker
What’s a Container? 
• An isolated environment to run user-mode code 
• Looks like you have the OS to yourself 
• An initial file system called an image 
• Minimal - a lot less than a full Linux distro 
• Very fast to start - less than a second 
• Network connections
Images 
• Start with a base - very minimal 
• Add packages using usual tools - e.g. apt, yum 
• Dockerfile is a recipe to build the image 
• Not needed at run-time
Dockerfile 
FROM ubuntu:12.10 
RUN apt-get update && apt-get install -y redis-server 
EXPOSE 6379 
ENTRYPOINT ["/usr/bin/redis-server"]
Connections 
• Open network ports to the outside world 
• Connect ports between containers via a private 
network 
• Mount persistent storage - c.f. Amazon EBS
Zen of Containers 
• Devs fill containers - with code 
• Ops slings them around 
• c.f. intermodal cargo containers
Collaboration 
• Docker Hub provides a GitHub-like experience to 
publish/share containers 
• Traditional VMs hard to share 
• Automated build from GH or BB 
• Private DockerHub available 
• Private, on-premise registry available (& free)
Cold Fusion and Unicorns? 
• Image files are composed of layers - 
one for each step in Dockerfile 
• Each layer is actually an image 
• Each layer is a diff from the previous 
layer 
• The top layer is read-write 
• All done efficiently with union file system
No Neck Beard? 
No Problem 
• Boot2Docker runs on Mac and Windows to provide 
development environment to run Docker 
• VM running minimal Linux kernel and OS 
• Same idea is useful in production - CoreOS
More Info 
• Docker.io 
• DockerBook.com 
• Software Engineering Radio podcast - se-radio.net 
• December 2014

Docker - Hack Salem! - November 2014

  • 1.
    Docker Charles Anderson Hack Salem - November 2014
  • 2.
    What is Docker? • An open platform for developing, shipping, and running applications • Linux-based • Why? Speed - ship code faster, including test and deployment • A solution to “works on my machine” Not!
  • 3.
  • 4.
    Containers • Containersare a lightweight virtualization technology • User-mode virtualization - not hardware virtualization • Benefits: density, speed, portability • Not new, and Docker isn’t the first
  • 5.
    Peace, Love and Understanding • Devs and ops working together with a common tool • “The real value of Docker is not technology. It’s getting people to agree on something.” - Solomon Hykes, CTO Docker
  • 6.
    What’s a Container? • An isolated environment to run user-mode code • Looks like you have the OS to yourself • An initial file system called an image • Minimal - a lot less than a full Linux distro • Very fast to start - less than a second • Network connections
  • 7.
    Images • Startwith a base - very minimal • Add packages using usual tools - e.g. apt, yum • Dockerfile is a recipe to build the image • Not needed at run-time
  • 8.
    Dockerfile FROM ubuntu:12.10 RUN apt-get update && apt-get install -y redis-server EXPOSE 6379 ENTRYPOINT ["/usr/bin/redis-server"]
  • 9.
    Connections • Opennetwork ports to the outside world • Connect ports between containers via a private network • Mount persistent storage - c.f. Amazon EBS
  • 10.
    Zen of Containers • Devs fill containers - with code • Ops slings them around • c.f. intermodal cargo containers
  • 11.
    Collaboration • DockerHub provides a GitHub-like experience to publish/share containers • Traditional VMs hard to share • Automated build from GH or BB • Private DockerHub available • Private, on-premise registry available (& free)
  • 12.
    Cold Fusion andUnicorns? • Image files are composed of layers - one for each step in Dockerfile • Each layer is actually an image • Each layer is a diff from the previous layer • The top layer is read-write • All done efficiently with union file system
  • 13.
    No Neck Beard? No Problem • Boot2Docker runs on Mac and Windows to provide development environment to run Docker • VM running minimal Linux kernel and OS • Same idea is useful in production - CoreOS
  • 14.
    More Info •Docker.io • DockerBook.com • Software Engineering Radio podcast - se-radio.net • December 2014