docker - hack salem! - november 2014

Post on 04-Jul-2015

90 Views

Category:

Software

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

A brief introduction to Docker presented at the Hack Salem! users group meeting in Salem, Oregon - November 2014

TRANSCRIPT

DockerCharles 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

top related