Warsaw JBUG, 28th May 2014


Applications are complex


Different deployment environments


But how?

Unified deployment format


A project to create and manage containers.


Yes, a lightweight operating system virtualization.

How this compares to a virtual machine?

It's completely different.


Virtual Machine (KVM, VMware)Container (LXC, OpenVZ)
HardwareSimulatedUses it (almost) directly
Supported OS'esAlmost anyOnly Linux
SpaceUser spaceKernel space
SeparationFullControl Groups (cgroups)
Startup timeSeconds to minutesMiliseconds
ScalabilityA fewSky is the limit (thousands)
Custom kernelYesNo
Enterprise features (live migration, etc)YesNo
Ease of creationModerateEasy
Time consumption of creationHighLow

Who's behind Docker?

Docker, Inc. and a powerful community.

Speaking of community...

  • GitHub
    • >800 watchers
    • >11000 stars
    • >1800 forks
    • >500 open issues
    • >80 pull requests
  • Over 400 contributors
    • avg 17 commits / day
    • 90% are external
  • Many meetups all over the world

Achieved after 15 months since first commit to GitHub


  • Image: a (read-only) template with filesystem and data
  • Container: a running image
  • Registry: place where images are hosted/shared

Main concepts

  • An image can be linked to a parent image
  • Image not having a parent is called base image
  • Container has a state, whereas image doesn't
  • You can launch multiple containers from an image

How does it work?

  • cgroups
    • groups processes in trees, single entity
  • namespaces
    • process isolation; network, pid, filesystem, etc
  • filesystem
    • aufs, btrfs, devicemapper

Show it!

Creating Docker images

It's simple! Use Dockerfiles.


A plain text file with instructions that automates building the image.

Dockerfile example

# Base on the Fedora 20 image
FROM fedora

# Upgrade the image
RUN yum -y update

# Install WildFly application server
RUN yum -y install wildfly

# Run WildFly after container boot
ENTRYPOINT /usr/share/wildfly/bin/ -c standalone-ha.xml -b

This should be saved as Dockerfile

Building the image

docker build .

Building the image

$ docker build .
Uploading context  2.56 kB
Uploading context 
Step 0 : FROM fedora
 ---> 58394af37342


Step 3 : ENTRYPOINT /usr/share/wildfly/bin/ -c standalone-ha.xml -b
 ---> Running in 72f63daffbd1
 ---> e91c26099a67
Removing intermediate container 72f63daffbd1
Successfully built e91c26099a67

We've built image e91c26099a67

Modifyng the image

  1. Change the Dockerfile
  2. Execute the build command once again

Image repositories

  1. Private: for example hosted inside a company
  2. Public:

OK, great, but...


  • Want your own PaaS?
  • Automated testing and CI
  • Deploying scalable apps


It's (fairly) easy to create a PaaS with Docker

There is even a tutorial to create one in 5 minutes...

Continuous Integration

  1. You commit
  2. CI builds the app
  3. CI creates an image with the new app
  4. CI starts a container from new image
  5. Integration tests are executed on a real application
  6. Profit!

Scalable apps

  • Requirement: prepare your app to be easily scalable
  • Starting a container is fast and cheap
  • Extending a (for example WildFly) cluster is easy
  • Profit!
Much JBoss

100 httpd servers in one minute, go!


(and remember to Docker all the things!)