WHAT? 
YOU'RE NOT USING 
DOCKER?
Cary Gordon 
The Cherry Hill Company 
Los Angeles, CA 
chillco.com 
info@chillco.com 
310-397-2999
CONTAINERS 
CAN’T LIVE WITHOUT THEM 
What? You're Not Using Docker?
CONTAINERS 
CAN’T LIVE WITHOUT THEM 
(Googled Hideous Dresser) 
What? You're Not Using Docker?
VIRTUALIZATION 
What? You're Not Using Docker?
CONTAINERIZATION 
(MIGHT NOT BE A WORD) 
What? You're Not Using Docker?
CONTAINERS 
• chroot 
Sandboxing (chroot jails) 
• Linux containers (LXC) 
chroot + OS isolation 
• Docker 
LXC + packaging 
What? You're Not Using Docker?
CONTAINERS 
What? You're Not Using Docker? 
Mechani 
sm 
Operating system License 
Availabl 
e 
since/be 
tween 
Features 
File 
system 
isolatio 
n 
Copy on 
Write 
Disk 
quotas 
I/O rate 
limiting 
Memory 
limits 
CPU 
quotas 
Network 
isolatio 
n 
Partition 
checkpo 
inting 
and live 
migratio 
n 
Root 
privileg 
e 
isolatio 
n 
chroot 
most UNIX-like 
operating systems 
varies by 
operating 
system 
1982 Partial No No No No No No No No 
LXC Linux GNU GPLv2 2014 Yes 
Partial. Yes 
withBtrfs. 
Partial. Yes 
withLVM or 
Disk quota. 
Yes Yes Yes Yes No Ye [9 
Docker 
Linux (using LXC), 
Windows/OS X (using 
LXC inside a lightweight 
Linux image) 
Apache 
License 2.0 
2013 Yes Yes Not directly Not directly Yes Yes Yes No No 
Drawn from http://wki.pe/Operating_system%E2%80%93level_virtualization 
Commercial alternative 
Parallels 
Virtuozzo 
Containers 
Linux, Windows Proprietary 2001 Yes Yes Yes Yes Yes Yes Yes Yes Yes
WHAT YOU CAN DO 
• Continuous Integration 
• Continuous Delivery 
• Distributed Applications 
• Easy Application Deployment 
• Platform-as-a-Service (PaaS) 
What? You're Not Using Docker?
DOCKER COMMANDS 
$ docker 
Usage: docker [OPTIONS] COMMAND [arg...] 
-H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use 
A self-sufficient runtime for linux containers. 
What? You're Not Using Docker? 
Commands: 
attach Attach to a running container 
build Build an image from a Dockerfile 
commit Create a new image from a container's changes 
cp Copy files/folders from a container's filesystem to the host path 
diff Inspect changes on a container's filesystem 
events Get real time events from the server 
export Stream the contents of a container as a tar archive 
history Show the history of an image 
images List images 
import Create a new filesystem image from the contents of a tarball 
info Display system-wide information 
inspect Return low-level information on a container 
kill Kill a running container 
load Load an image from a tar archive 
login Register or log in to a Docker registry server 
logout Log out from a Docker registry server 
logs Fetch the logs of a container 
port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT 
pause Pause all processes within a container 
ps List containers 
pull Pull an image or a repository from a Docker registry server 
push Push an image or a repository to a Docker registry server 
restart Restart a running container 
rm Remove one or more containers 
rmi Remove one or more images 
run Run a command in a new container 
save Save an image to a tar archive 
search Search for an image on the Docker Hub 
start Start a stopped container 
stop Stop a running container 
tag Tag an image into a repository 
top Lookup the running processes of a container 
unpause Unpause a paused container 
version Show the Docker version information 
wait Block until a container stops, then print its exit code
DOCKER JARGON 
• Docker an open platform for developers and sysadmins to build, ship, and run 
distributed applications anywhere. It uses the same binary for daemons and clients 
• Docker Hub a registry of Docker images 
• Dockerfile A simple script listing the commands to build a Docker image. Invoked with 
What? You're Not Using Docker? 
docker build 
• Daemon options Environment options including networking, storage, and exec 
through the libcontainer execution driver 
• boot2docker A minimal Virtualbox to run docker on OS X
DOCKER HUB 
What? You're Not Using Docker?
DOCKER HUB 
What? You're Not Using Docker?
DOCKER HUB 
What? You're Not Using Docker?
DOCKERFILE 
## 
# Drupal/SSH with Nginx, PHP5 and SQLite 
## 
FROM ubuntu:13.04 
MAINTAINER http://www.github.com/b7alt/ by b7alt 
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list 
RUN apt-get update && apt-get upgrade -y 
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor openssh-server nginx php5-fpm php5-sqlite php5-gd drush emacs php-apc 
RUN update-rc.d nginx disable 
RUN update-rc.d php5-fpm disable 
RUN update-rc.d supervisor disable 
RUN update-rc.d ssh disable 
What? You're Not Using Docker? 
EXPOSE 22 80 
RUN mkdir -p /var/run/sshd /srv/drupal/www /srv/drupal/config /srv/data /srv/logs /tmp 
ADD site.conf /srv/drupal/config/site.conf 
ADD nginx.conf /nginx.conf 
ADD php-fpm.conf /php-fpm.conf 
ADD supervisord.conf /supervisord.conf 
ADD settings.php.append /settings.php.append 
RUN cd /tmp && drush dl drupal && mv /tmp/drupal*/* /srv/drupal/www/ && rm -rf /tmp/* 
RUN chmod a+w /srv/drupal/www/sites/default && mkdir /srv/drupal/www/sites/default/files 
RUN chown -R www-data:www-data /srv/drupal/www/ 
RUN cp /srv/drupal/www/sites/default/default.settings.php /srv/drupal/www/sites/default/settings.php 
RUN chmod a+w /srv/drupal/www/sites/default/settings.php 
RUN chown www-data:www-data /srv/data 
#RUN chmod a+w /srv/drupal/www/sites/default/files 
RUN cd /srv/drupal/www/ && drush -y site-install standard --account-name=admin --account-pass=test --db-url=sqlite:sites/default/files/.ht.sqlite 
RUN cat /settings.php.append >> /srv/drupal/www/sites/default/settings.php 
RUN cd /srv/drupal/www/ && drush -y dl environment_indicator devel 
RUN cd /srv/drupal/www/ && drush -y en environment_indicator devel 
RUN ls -al /srv/drupal/www/sites/default/files 
RUN chown -R www-data:www-data /srv/drupal/www/sites/default/files/.ht.sqlite 
RUN chmod a-w /srv/drupal/www/sites/default/settings.php 
RUN echo "root:root" | chpasswd 
ENTRYPOINT [ "/usr/bin/supervisord", "-n", "-c", "/supervisord.conf", "-e", "trace" ]
DOCKER HUB 
What? You're Not Using Docker?
X 
• https://docker.com/ 
• https://hub.docker.com/ 
• http://www.dockerbook.com/ 
• https://www.docker.com/tryit/ 
• http://learningdocker.com/ 
• http://www.ansible.com/docker 
What? You're Not Using Docker?

Docker

  • 1.
    WHAT? YOU'RE NOTUSING DOCKER?
  • 2.
    Cary Gordon TheCherry Hill Company Los Angeles, CA chillco.com info@chillco.com 310-397-2999
  • 3.
    CONTAINERS CAN’T LIVEWITHOUT THEM What? You're Not Using Docker?
  • 4.
    CONTAINERS CAN’T LIVEWITHOUT THEM (Googled Hideous Dresser) What? You're Not Using Docker?
  • 5.
    VIRTUALIZATION What? You'reNot Using Docker?
  • 6.
    CONTAINERIZATION (MIGHT NOTBE A WORD) What? You're Not Using Docker?
  • 7.
    CONTAINERS • chroot Sandboxing (chroot jails) • Linux containers (LXC) chroot + OS isolation • Docker LXC + packaging What? You're Not Using Docker?
  • 8.
    CONTAINERS What? You'reNot Using Docker? Mechani sm Operating system License Availabl e since/be tween Features File system isolatio n Copy on Write Disk quotas I/O rate limiting Memory limits CPU quotas Network isolatio n Partition checkpo inting and live migratio n Root privileg e isolatio n chroot most UNIX-like operating systems varies by operating system 1982 Partial No No No No No No No No LXC Linux GNU GPLv2 2014 Yes Partial. Yes withBtrfs. Partial. Yes withLVM or Disk quota. Yes Yes Yes Yes No Ye [9 Docker Linux (using LXC), Windows/OS X (using LXC inside a lightweight Linux image) Apache License 2.0 2013 Yes Yes Not directly Not directly Yes Yes Yes No No Drawn from http://wki.pe/Operating_system%E2%80%93level_virtualization Commercial alternative Parallels Virtuozzo Containers Linux, Windows Proprietary 2001 Yes Yes Yes Yes Yes Yes Yes Yes Yes
  • 9.
    WHAT YOU CANDO • Continuous Integration • Continuous Delivery • Distributed Applications • Easy Application Deployment • Platform-as-a-Service (PaaS) What? You're Not Using Docker?
  • 10.
    DOCKER COMMANDS $docker Usage: docker [OPTIONS] COMMAND [arg...] -H=[unix:///var/run/docker.sock]: tcp://host:port to bind/connect to or unix://path/to/socket to use A self-sufficient runtime for linux containers. What? You're Not Using Docker? Commands: attach Attach to a running container build Build an image from a Dockerfile commit Create a new image from a container's changes cp Copy files/folders from a container's filesystem to the host path diff Inspect changes on a container's filesystem events Get real time events from the server export Stream the contents of a container as a tar archive history Show the history of an image images List images import Create a new filesystem image from the contents of a tarball info Display system-wide information inspect Return low-level information on a container kill Kill a running container load Load an image from a tar archive login Register or log in to a Docker registry server logout Log out from a Docker registry server logs Fetch the logs of a container port Lookup the public-facing port that is NAT-ed to PRIVATE_PORT pause Pause all processes within a container ps List containers pull Pull an image or a repository from a Docker registry server push Push an image or a repository to a Docker registry server restart Restart a running container rm Remove one or more containers rmi Remove one or more images run Run a command in a new container save Save an image to a tar archive search Search for an image on the Docker Hub start Start a stopped container stop Stop a running container tag Tag an image into a repository top Lookup the running processes of a container unpause Unpause a paused container version Show the Docker version information wait Block until a container stops, then print its exit code
  • 11.
    DOCKER JARGON •Docker an open platform for developers and sysadmins to build, ship, and run distributed applications anywhere. It uses the same binary for daemons and clients • Docker Hub a registry of Docker images • Dockerfile A simple script listing the commands to build a Docker image. Invoked with What? You're Not Using Docker? docker build • Daemon options Environment options including networking, storage, and exec through the libcontainer execution driver • boot2docker A minimal Virtualbox to run docker on OS X
  • 12.
    DOCKER HUB What?You're Not Using Docker?
  • 13.
    DOCKER HUB What?You're Not Using Docker?
  • 14.
    DOCKER HUB What?You're Not Using Docker?
  • 15.
    DOCKERFILE ## #Drupal/SSH with Nginx, PHP5 and SQLite ## FROM ubuntu:13.04 MAINTAINER http://www.github.com/b7alt/ by b7alt RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update && apt-get upgrade -y RUN DEBIAN_FRONTEND=noninteractive apt-get install -y supervisor openssh-server nginx php5-fpm php5-sqlite php5-gd drush emacs php-apc RUN update-rc.d nginx disable RUN update-rc.d php5-fpm disable RUN update-rc.d supervisor disable RUN update-rc.d ssh disable What? You're Not Using Docker? EXPOSE 22 80 RUN mkdir -p /var/run/sshd /srv/drupal/www /srv/drupal/config /srv/data /srv/logs /tmp ADD site.conf /srv/drupal/config/site.conf ADD nginx.conf /nginx.conf ADD php-fpm.conf /php-fpm.conf ADD supervisord.conf /supervisord.conf ADD settings.php.append /settings.php.append RUN cd /tmp && drush dl drupal && mv /tmp/drupal*/* /srv/drupal/www/ && rm -rf /tmp/* RUN chmod a+w /srv/drupal/www/sites/default && mkdir /srv/drupal/www/sites/default/files RUN chown -R www-data:www-data /srv/drupal/www/ RUN cp /srv/drupal/www/sites/default/default.settings.php /srv/drupal/www/sites/default/settings.php RUN chmod a+w /srv/drupal/www/sites/default/settings.php RUN chown www-data:www-data /srv/data #RUN chmod a+w /srv/drupal/www/sites/default/files RUN cd /srv/drupal/www/ && drush -y site-install standard --account-name=admin --account-pass=test --db-url=sqlite:sites/default/files/.ht.sqlite RUN cat /settings.php.append >> /srv/drupal/www/sites/default/settings.php RUN cd /srv/drupal/www/ && drush -y dl environment_indicator devel RUN cd /srv/drupal/www/ && drush -y en environment_indicator devel RUN ls -al /srv/drupal/www/sites/default/files RUN chown -R www-data:www-data /srv/drupal/www/sites/default/files/.ht.sqlite RUN chmod a-w /srv/drupal/www/sites/default/settings.php RUN echo "root:root" | chpasswd ENTRYPOINT [ "/usr/bin/supervisord", "-n", "-c", "/supervisord.conf", "-e", "trace" ]
  • 16.
    DOCKER HUB What?You're Not Using Docker?
  • 17.
    X • https://docker.com/ • https://hub.docker.com/ • http://www.dockerbook.com/ • https://www.docker.com/tryit/ • http://learningdocker.com/ • http://www.ansible.com/docker What? You're Not Using Docker?