SlideShare a Scribd company logo
Deploying

with Docker
DevOps Days PGH
2014.05.30
a.k.a. provisioning docker containers and images with Chef
Deploying

with Docker
(or not)
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Why do we still need

<insert tool here>?
But… we have
Dockerfiles!
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
It’s a shell-script?
$ cat SomeApp/Dockerfile



FROM ubuntu:13.10



RUN apt-get update; apt-get install apache

RUN sed ’s/something/else/‘ /etc/apache/httpd.conf



ADD shell-script.sh

RUN shell-script.sh



RUN [‘/usr/bin/apachectl’, ‘start’]
I ♥ #!/bin/bash
. oo # https://raw.githubusercontent.com/

# ewindisch/bashoo/master/lib/oo



# Classes are created implicitly through functions

function MsgWriter::new {

self=$1; shift

msg=$1; shift

instance_var $self msg $msg 

}

function MsgWriter::write {

self=$1; shift

echo $($self.msg)

}



new terminal is MsgWriter “Hello World”

terminal.write
stack:~/devstack$ wc -l stack.sh functions 

functions-common 

lib/* lib/*/* | tail -n1
15490 total
DevOps

or
crazy-sauce
?
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
$ cd ~/rpm-chef

$ cat Dockerfile

FROM fedora

RUN yum update 

yum -y install chef
DockerChef
$ cd ~/omnibus-chef

$ cat Dockerfile

FROM fedora"
RUN curl -L 

https://www.opscode.com/chef/install.sh |

/bin/bash
DockerChef
Traditional Chef
Hardware
OS
Linux
Chef
Installs Chef
Runs
Configures
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Images on HW

is usually mutable
Hardware
Image
Linux
Chef
Installs Chef
Image'
Linux
Chef
Creates
Replaces
Runs
Ephemeral environments

are (somewhat) immutable.
Hypervisor
Image
Linux
Chef
Runs
Image'
Linux
Chef
Chef
Runs
Configures
VM
Accesses
COW
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Chef-for-runtime
$ cat Dockerfile

FROM fedora

RUN yum update; 

yum -y install chef

ADD http://x/receipes.tar.gz /opt/chef"
ADD solo.rb /etc/chef/solo.rb"
CMD chef-solo -c /etc/chef/solo.rb ; !
apachectl start
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Containers

are

THINGS
X
X
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Servers vs Things


Pets vs Cattle
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
LET US 

BAKE

IMAGES!
Let us
BAKE
images!
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Containers are like
ephemeral VMs*
* Docker containers don’t HAVE to be ephemeral,
but it’s TheRightThing
Docker
Image
Linux
Chef
Runs
Image'
Linux
Chef
Chef
Runs
Configures
Container
Accesses
COW
TM
Bakery Chef
$ cat Dockerfile

FROM fedora

RUN yum update; 

yum -y install chef"


ADD http://x/receipes.tar.gz /opt/chef"
ADD solo.rb /etc/chef/solo.rb"
RUN chef-solo -c /etc/chef/solo.rb

Burning configuration

into images.
Docker ContainerInitiates Creates
Image
Linux
Chef
Chef
Runs
Configures
Build Creates
Expanded view:

Burning configuration into
images.
Docker Image tagInitiates
Image'
Linux
Chef
Chef
Build
Image
Linux
Chef
Creates
Creates
Runs Creates
References
1
2
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Anatomy of a Docker
+Chef build & run
Docker ContainerInitiates Creates
Image
Linux
Chef
Chef
Runs
Configures
Chef
Runs
Configures
Build Creates
Stage 1 Stage 2
For All The Things!
$ cat Dockerfile

FROM fedora

RUN yum update; 

yum -y install chef



ADD http://x/receipes.tar.gz /opt/chef"
ADD solo-stage1.rb /etc/chef/solo-stage1.rb"
ADD solo-stage2.rb /etc/chef/solo-stage2.rb"
RUN chef-solo -c /etc/chef/solo-stage1.rb"
CMD chef-solo -c /etc/chef/solo-stage2.rb; "
apachectl start
Does it converge?
$ docker build —rm .

$ echo $? # pass or fail
(This is great use of Docker as an
alternative to VMs for testing Chef recipes
targeting non-Docker production systems)
Deploying Docker
(for real this time)
#!/bin/bash -x
aws ec2 run-instances 
--image-id ami-e55a648c 
--key-name my-key 
--user-data "#include https://get.docker.io”


ip=$(aws ec2 describe-instances 
--output json 
--filter Name=instance-state-name,Values=running | python 
-c 'import json; import sys; print json.load(sys.stdin)
[“Reservations”][0]["Instances"][0]["PublicIpAddress"]')


ssh ubuntu@$ip sudo docker run cirros
# using https://github.com/bflad/chef-docker


$ cat cookbooks/docker-registry/default.rb

# Pull latest image
docker_image 'samalba/docker-registry'
!
# Run container exposing ports
docker_container 'samalba/docker-registry' do
detach true
port '5000:5000'
env 'SETTINGS_FLAVOR=local'
volume '/mnt/docker:/docker-storage'
end



$ knife ec2 server create # yada yada yada
docker::run { 'helloworld':

image => 'base',

command => '/bin/sh -c "while true; do echo
hello world; sleep 1; done"',

ports => ['4444', '4555'],

links => ['mysql:db'],

use_name => true,

volumes => ['/var/lib/couchdb', '/var/log'],

volumes_from => '6446ea52fbc9',

memory_limit => 10485760, # bytes 

username => 'example',

hostname => 'example.com',

env => ['FOO=BAR', 'FOO2=BAR2'],

dns => ['8.8.8.8', '8.8.4.4'],

restart_service => true,

}
Orchestration for Docker

with OpenStack Heat
DockerInc::Docker:
:Container
VMs
Baremetal
Heat Workflow
Heat API
VM
Docker
NovaNova resource
Docker resource
Container1
Container2
Container3
HOT
heat_template_version: 2013-05-23
description: shared volumes example
resources:
my_instance:
type: OS::Nova::Server
properties:
key_name: ewindisch_key
image: ubuntu-precise
flavor: m1.large
user_data: #include https://get.docker.io
ftp_container:
type: DockerInc::Docker::Container
properties:
docker_endpoint: { get_attr: 

[my_instance, first_address] }
image: mikz/vsftpd

ports: [ “21:21” ]

volumes: [ “/ftp” ]
name: “FTP”





apache_container:
type: DockerInc::Docker::Container
properties:
docker_endpoint: { get_attr: 

[my_instance, first_address] }
image: fedora/apache
ports: [ “80:80” ]
volumes-from: “FTP”
cmd: “rm -rf /var/www; 

ln -s /ftp /var/www;

/run-apache.sh”
Ansible
- hosts: web

sudo: yes

tasks:

- name: ensure redis container is running

docker: image=crosbymichael/redis name=redis



- name: ensure redis_ambassador container is running

docker: image=svendowideit/ambassador 

ports=6379:6379 links=redis:redis 

name=redis_ambassador_ansible
Mesos Flynn.io
Creating Containers
is Easy
Managing them
SUCKS
needs improvement
This is probably
material for another
talk…
Container Inventory
• discoverd / sdutil
• serf
• skydock
• others?
X
X
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Q & A
@ewindisch

More Related Content

PDF
Docker by Example - Basics
PDF
Shipping Applications to Production in Containers with Docker
PDF
Docker presentation | Paris Docker Meetup
PDF
Solving Real World Production Problems with Docker
ODP
Docker - The Linux Container
PDF
Using Docker with Puppet - PuppetConf 2014
PDF
From development environments to production deployments with Docker, Compose,...
PDF
Docker and Puppet — Puppet Camp L.A. — SCALE12X
Docker by Example - Basics
Shipping Applications to Production in Containers with Docker
Docker presentation | Paris Docker Meetup
Solving Real World Production Problems with Docker
Docker - The Linux Container
Using Docker with Puppet - PuppetConf 2014
From development environments to production deployments with Docker, Compose,...
Docker and Puppet — Puppet Camp L.A. — SCALE12X

What's hot (20)

PPT
Amazon Web Services and Docker
PDF
Running Django on Docker: a workflow and code
PPTX
Architecting .NET Applications for Docker and Container Based Deployments
PDF
OpenStack - Docker - Rackspace HQ
PPTX
Docker toolbox
PPTX
Installaling Puppet Master and Agent
PDF
A Hands-on Introduction to Docker
PDF
Docker at Djangocon 2013 | Talk by Ken Cochrane
PPTX
Austin - Container Days - Docker 101
PDF
Docker on Google App Engine
PDF
Using Docker in the Real World
PDF
Introduction To Docker
PPTX
Docker-hanoi meetup #1: introduction about Docker
PPTX
Docker orchestration
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
PDF
Docker Started
PDF
Provisioning & Deploying with Docker
PDF
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
PDF
Docker for Devs - John Zaccone, IBM
PDF
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Amazon Web Services and Docker
Running Django on Docker: a workflow and code
Architecting .NET Applications for Docker and Container Based Deployments
OpenStack - Docker - Rackspace HQ
Docker toolbox
Installaling Puppet Master and Agent
A Hands-on Introduction to Docker
Docker at Djangocon 2013 | Talk by Ken Cochrane
Austin - Container Days - Docker 101
Docker on Google App Engine
Using Docker in the Real World
Introduction To Docker
Docker-hanoi meetup #1: introduction about Docker
Docker orchestration
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker Started
Provisioning & Deploying with Docker
What's New in Docker 1.12 by Nishant Totla for Docker SF Meetup 08.03.16
Docker for Devs - John Zaccone, IBM
Docker Presentation at the OpenStack Austin Meetup | 2013-09-12
Ad

Viewers also liked (20)

PDF
Immutable infrastructure with Docker and containers (GlueCon 2015)
PDF
Microservices 101: From DevOps to Docker and beyond
PDF
Package your Java EE Application using Docker and Kubernetes
PDF
Kubernetes Networking
PDF
A Gentle Introduction To Docker And All Things Containers
PPTX
Why Docker
PPTX
Docker introduction
PPTX
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
PDF
hafentalks #1 - Chad Fowler: Impermanence as the key to good systems thinking
PPTX
Baking docker using chef
PPTX
Deploying services: automation with docker and ansible
PDF
{py}gradle
PPTX
Infrastructure modeling with chef
PPTX
What's new in chef 12
PDF
Docker Enables DevOps - Keep C.A.L.M.S. and Docker on ...
PPTX
Fits docker into devops
PDF
Effective DevOps by using Docker and Chef together !
PDF
Python+gradle
PDF
Modern devOps with Docker
PDF
Inside the Chef Push Jobs Service - ChefConf 2015
Immutable infrastructure with Docker and containers (GlueCon 2015)
Microservices 101: From DevOps to Docker and beyond
Package your Java EE Application using Docker and Kubernetes
Kubernetes Networking
A Gentle Introduction To Docker And All Things Containers
Why Docker
Docker introduction
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
hafentalks #1 - Chad Fowler: Impermanence as the key to good systems thinking
Baking docker using chef
Deploying services: automation with docker and ansible
{py}gradle
Infrastructure modeling with chef
What's new in chef 12
Docker Enables DevOps - Keep C.A.L.M.S. and Docker on ...
Fits docker into devops
Effective DevOps by using Docker and Chef together !
Python+gradle
Modern devOps with Docker
Inside the Chef Push Jobs Service - ChefConf 2015
Ad

Similar to Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH (20)

PDF
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
PPTX
Baking Docker Using Chef - ChefConf 2015
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
PDF
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
PDF
Baking Docker Using Chef
PPSX
Docker and containers - Presentation Slides by Priyadarshini Anand
PPTX
Docker - Demo on PHP Application deployment
PDF
Testable Infrastructure with Chef, Test Kitchen, and Docker
PPTX
Docker and configuration management
PDF
Scale Big With Docker — Moboom 2014
PDF
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PDF
Docker, the Future of DevOps
PPTX
Docker Starter Pack
PDF
Docker From Scratch
PDF
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
PPTX
Powercoders · Docker · Fall 2021.pptx
PDF
Computer science docker file Week -6 to7
ODP
Chef, Vagrant, and VirtualBox
PDF
Work shop - an introduction to the docker ecosystem
PDF
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Baking Docker Using Chef - ChefConf 2015
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Baking Docker Using Chef
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker - Demo on PHP Application deployment
Testable Infrastructure with Chef, Test Kitchen, and Docker
Docker and configuration management
Scale Big With Docker — Moboom 2014
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
Docker, the Future of DevOps
Docker Starter Pack
Docker From Scratch
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Powercoders · Docker · Fall 2021.pptx
Computer science docker file Week -6 to7
Chef, Vagrant, and VirtualBox
Work shop - an introduction to the docker ecosystem
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef

More from Erica Windisch (10)

PDF
Debugging & Profiling of AWS Lambda: ServerlessConf - IOpipe
PPTX
Embracing Serverless Ops (Lightning Talk)
PDF
Ops for NoOps - Operational Challenges for Serverless Apps
PDF
Building Composable Serverless Apps with IOpipe
PDF
Patterns for Secure Containerized Applications (Docker)
PDF
Orchestrating Docker with OpenStack
PDF
Things will Change - Usenix Keynote UCMS'14
PDF
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
PDF
Practical Docker for OpenStack - NYC / PHL OpenStack meetup (4-23-2014)
PDF
Docker OpenStack - 3/27/2014
Debugging & Profiling of AWS Lambda: ServerlessConf - IOpipe
Embracing Serverless Ops (Lightning Talk)
Ops for NoOps - Operational Challenges for Serverless Apps
Building Composable Serverless Apps with IOpipe
Patterns for Secure Containerized Applications (Docker)
Orchestrating Docker with OpenStack
Things will Change - Usenix Keynote UCMS'14
Practical Docker for OpenStack (Juno Summit - May 15th, 2014)
Practical Docker for OpenStack - NYC / PHL OpenStack meetup (4-23-2014)
Docker OpenStack - 3/27/2014

Recently uploaded (20)

PDF
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
Dell Pro 14 Plus: Be better prepared for what’s coming
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
REPORT: Heating appliances market in Poland 2024
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PPTX
CroxyProxy Instagram Access id login.pptx
PDF
KodekX | Application Modernization Development
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
CIFDAQ's Teaching Thursday: Moving Averages Made Simple
Chapter 3 Spatial Domain Image Processing.pdf
Belt and Road Supply Chain Finance Blockchain Solution
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
Sensors and Actuators in IoT Systems using pdf
Dell Pro 14 Plus: Be better prepared for what’s coming
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
REPORT: Heating appliances market in Poland 2024
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Web Security: Login Bypass, SQLi, CSRF & XSS.pptx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
A Day in the Life of Location Data - Turning Where into How.pdf
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
CroxyProxy Instagram Access id login.pptx
KodekX | Application Modernization Development
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Transforming Manufacturing operations through Intelligent Integrations
creating-agentic-ai-solutions-leveraging-aws.pdf

Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH

  • 1. Deploying
 with Docker DevOps Days PGH 2014.05.30 a.k.a. provisioning docker containers and images with Chef Deploying
 with Docker (or not)
  • 6. Why do we still need
 <insert tool here>?
  • 9. It’s a shell-script? $ cat SomeApp/Dockerfile
 
 FROM ubuntu:13.10
 
 RUN apt-get update; apt-get install apache
 RUN sed ’s/something/else/‘ /etc/apache/httpd.conf
 
 ADD shell-script.sh
 RUN shell-script.sh
 
 RUN [‘/usr/bin/apachectl’, ‘start’]
  • 10. I ♥ #!/bin/bash . oo # https://raw.githubusercontent.com/
 # ewindisch/bashoo/master/lib/oo
 
 # Classes are created implicitly through functions
 function MsgWriter::new {
 self=$1; shift
 msg=$1; shift
 instance_var $self msg $msg 
 }
 function MsgWriter::write {
 self=$1; shift
 echo $($self.msg)
 }
 
 new terminal is MsgWriter “Hello World”
 terminal.write
  • 11. stack:~/devstack$ wc -l stack.sh functions 
 functions-common 
 lib/* lib/*/* | tail -n1 15490 total
  • 14. $ cd ~/rpm-chef
 $ cat Dockerfile
 FROM fedora
 RUN yum update 
 yum -y install chef DockerChef
  • 15. $ cd ~/omnibus-chef
 $ cat Dockerfile
 FROM fedora" RUN curl -L 
 https://www.opscode.com/chef/install.sh |
 /bin/bash DockerChef
  • 18. Images on HW
 is usually mutable Hardware Image Linux Chef Installs Chef Image' Linux Chef Creates Replaces Runs
  • 19. Ephemeral environments
 are (somewhat) immutable. Hypervisor Image Linux Chef Runs Image' Linux Chef Chef Runs Configures VM Accesses COW
  • 21. Chef-for-runtime $ cat Dockerfile
 FROM fedora
 RUN yum update; 
 yum -y install chef
 ADD http://x/receipes.tar.gz /opt/chef" ADD solo.rb /etc/chef/solo.rb" CMD chef-solo -c /etc/chef/solo.rb ; ! apachectl start
  • 30. X
  • 31. X
  • 37. Containers are like ephemeral VMs* * Docker containers don’t HAVE to be ephemeral, but it’s TheRightThing Docker Image Linux Chef Runs Image' Linux Chef Chef Runs Configures Container Accesses COW TM
  • 38. Bakery Chef $ cat Dockerfile
 FROM fedora
 RUN yum update; 
 yum -y install chef" 
 ADD http://x/receipes.tar.gz /opt/chef" ADD solo.rb /etc/chef/solo.rb" RUN chef-solo -c /etc/chef/solo.rb

  • 39. Burning configuration
 into images. Docker ContainerInitiates Creates Image Linux Chef Chef Runs Configures Build Creates
  • 40. Expanded view:
 Burning configuration into images. Docker Image tagInitiates Image' Linux Chef Chef Build Image Linux Chef Creates Creates Runs Creates References 1 2
  • 43. Anatomy of a Docker +Chef build & run Docker ContainerInitiates Creates Image Linux Chef Chef Runs Configures Chef Runs Configures Build Creates Stage 1 Stage 2
  • 44. For All The Things! $ cat Dockerfile
 FROM fedora
 RUN yum update; 
 yum -y install chef
 
 ADD http://x/receipes.tar.gz /opt/chef" ADD solo-stage1.rb /etc/chef/solo-stage1.rb" ADD solo-stage2.rb /etc/chef/solo-stage2.rb" RUN chef-solo -c /etc/chef/solo-stage1.rb" CMD chef-solo -c /etc/chef/solo-stage2.rb; " apachectl start
  • 45. Does it converge? $ docker build —rm .
 $ echo $? # pass or fail (This is great use of Docker as an alternative to VMs for testing Chef recipes targeting non-Docker production systems)
  • 47. #!/bin/bash -x aws ec2 run-instances --image-id ami-e55a648c --key-name my-key --user-data "#include https://get.docker.io” 
 ip=$(aws ec2 describe-instances --output json --filter Name=instance-state-name,Values=running | python -c 'import json; import sys; print json.load(sys.stdin) [“Reservations”][0]["Instances"][0]["PublicIpAddress"]') 
 ssh ubuntu@$ip sudo docker run cirros
  • 48. # using https://github.com/bflad/chef-docker 
 $ cat cookbooks/docker-registry/default.rb
 # Pull latest image docker_image 'samalba/docker-registry' ! # Run container exposing ports docker_container 'samalba/docker-registry' do detach true port '5000:5000' env 'SETTINGS_FLAVOR=local' volume '/mnt/docker:/docker-storage' end
 
 $ knife ec2 server create # yada yada yada
  • 49. docker::run { 'helloworld':
 image => 'base',
 command => '/bin/sh -c "while true; do echo hello world; sleep 1; done"',
 ports => ['4444', '4555'],
 links => ['mysql:db'],
 use_name => true,
 volumes => ['/var/lib/couchdb', '/var/log'],
 volumes_from => '6446ea52fbc9',
 memory_limit => 10485760, # bytes 
 username => 'example',
 hostname => 'example.com',
 env => ['FOO=BAR', 'FOO2=BAR2'],
 dns => ['8.8.8.8', '8.8.4.4'],
 restart_service => true,
 }
  • 50. Orchestration for Docker
 with OpenStack Heat DockerInc::Docker: :Container VMs Baremetal
  • 51. Heat Workflow Heat API VM Docker NovaNova resource Docker resource Container1 Container2 Container3 HOT
  • 52. heat_template_version: 2013-05-23 description: shared volumes example resources: my_instance: type: OS::Nova::Server properties: key_name: ewindisch_key image: ubuntu-precise flavor: m1.large user_data: #include https://get.docker.io ftp_container: type: DockerInc::Docker::Container properties: docker_endpoint: { get_attr: 
 [my_instance, first_address] } image: mikz/vsftpd
 ports: [ “21:21” ]
 volumes: [ “/ftp” ] name: “FTP”
 
 
 apache_container: type: DockerInc::Docker::Container properties: docker_endpoint: { get_attr: 
 [my_instance, first_address] } image: fedora/apache ports: [ “80:80” ] volumes-from: “FTP” cmd: “rm -rf /var/www; 
 ln -s /ftp /var/www;
 /run-apache.sh”
  • 53. Ansible - hosts: web
 sudo: yes
 tasks:
 - name: ensure redis container is running
 docker: image=crosbymichael/redis name=redis
 
 - name: ensure redis_ambassador container is running
 docker: image=svendowideit/ambassador 
 ports=6379:6379 links=redis:redis 
 name=redis_ambassador_ansible
  • 57. This is probably material for another talk…
  • 58. Container Inventory • discoverd / sdutil • serf • skydock • others?
  • 59. X
  • 60. X