SlideShare a Scribd company logo
10/17/2013 - Docker @ RelateIQ - Scott Bessler & John Fiedler
Docker @ RelateIQ

@

Scott Bessler
scott@relateiq.com
@scottbessler

John Fiedler
john@relateiq.com
@johnfiedler

Blog
blog.relateiq.com
RelateIQ Twitter
@relateiq

File Repo
https://github.com/relateiq/docker_public
Agenda

● Part 1 - What we did with Docker
● Part 2 - Why we want to replace Chef
● Part 3 - Future plans using Docker
Part 1. Things were getting out of control... Bring on hack day!

+

+
Hack Day!

=

=
What we needed to build
Docker Files

Minimum

Kafka
MongoDB
Redis
Cassandra
Zookeeper
Elasticsearch

Crushing IT

Docker Files

Storm
Jetty
Nginx

+ Private Docker Registry
End product

MAC OS X
$ devenv start

One
Command!

$ devenv-inner start
Kafka

VM

Containers

MongoDB
Redis
Cassandra
Zookeeper

ubuntu

Elasticsearch
Orchestration scripts

devenv.sh (outer)
[up|update|ssh]
●
●

Controls Vagrant
Controls inner script

devenv-inner.sh (inner)
[stop|start|kill|update|status|restart]
●

Controls Docker containers

update(){
start(){

apt-get update

mkdir -p $APPS/zookeeper/data

apt-get install -y lxc-docker

mkdir -p $APPS/zookeeper/logs
ZOOKEEPER=$(docker run 

docker pull server:4444/zookeeper

-d 

docker pull server:4444/redis

-p 2181:2181 

docker pull server:4444/cassandra

-v $APPS/zookeeper/logs:/logs

docker pull server:4444/elasticsearch

server:4444/zookeeper)

docker pull server:4444/mongo

echo "Started ZOOKEEPER in
container $ZOOKEEPER"
echo "Wiring containers together… "

docker pull server:4444/kafka
}

kill/stop(){

(later slide)

echo "Killing all docker containers:"
docker ps | tail -n +2 |cut -d ' ' -f 1 | xargs docker kill
}
Dockerfile’s

Dockerfile

FROM server:4444/oracle-java7

Std Image

RUN apt-get update
RUN apt-get install -y git curl build-essential make gcc wget

RUN cd /opt && wget http://apache.mirrors.pair.com/cassandra/1.2.9/apachecassandra-1.2.9-bin.tar.gz
RUN cd /opt && tar zxf apache-cassandra-*.tar.gz
RUN rm /opt/*.tar.gz
RUN mv /opt/apache-cassandra-* /opt/cassandra

RUN apt-get install -y lsof
#!/bin/bash

echo "Cassandra node
configuration:"
echo $CASS_SEEDS
echo $CASS_TOKEN

start.sh

echo $CASS_LOCAL_IP

HOST=`hostname`
echo "127.0.0.1 $HOST" >>
/etc/hosts

/opt/cassandra/bin/cassandra -f

ADD cassandra.yaml /opt/cassandra/conf/cassandra.yaml
ADD cassandra-env.sh /opt/cassandra/conf/cassandra-env.sh
ADD log4j-server.properties /opt/cassandra/conf/log4j-server.properties
ADD start.sh /opt/cassandra/bin/start.sh
ADD cassandra-topology.properties /opt/cassandra/conf/cassandra-topology.
properties
RUN chmod 755 /opt/cassandra/bin/start.sh
RUN mkdir /logs
...
VOLUME [ "/logs" ]
...
EXPOSE 7000
….
CMD "/opt/cassandra/bin/start.sh"
Networking - port forwarding

Question:
Dude, where’s mongo?
Answer:
Port forwarding
Example:
> Docker file
expose 9999 (dockerfile)

> Docker

Machine
localhost:27019

vagrant
config.vm.forward_port 9999,27019

docker
run -p 9999:27018

docker run -p 8000:9999

> VAGRANT
config.vm.forward_port 27018, 8000

> localhost:8000

docker file
expose 27018
MongoDB

Tip:
Always use the same port if you can

Containers
Networking - connecting two containers

Question:
Kafka: Dude, where’s Zookeeper?

Answer:
Pipework

Machine
vagrant

https://github.com/jpetazzo/pipework

Example:

docker

> startup the container
KAFKA = docker run -e zooip=192.168.1.1

pipework br1

> Pipework
pipework br1 $KAFKA 192.168.1.2
pipework br1 $ZOOKEEPER 192.168.1.1
(dockerfile)
Zookeeper

Tip:
Use this for clustering

Kafka

192.168.1.1

192.168.1.2

Containers
Best practices

What we found

Machine
*Abstraction

●
●
●
●

Data
Logs
Don’t end with tailing
End with foreground
execution
● Start script for runtime
configuration
● 42 layers, combine
Dockerfile lines
● Up Vagrant RAM default

VM
/logs/mongo
/data/mongo

/logs/kafka
/data/kafka

*Standard Data and log dirs
*Static IP

MongoDB

Kafka

*Start Script
*Foreground Execution
*42 layers only

Containers
Chef

4 reasons why we want to replace Chef
with Docker in prod
1. Dynamic Configuration Is Too Complex

Chef
● Dynamic configuration
through complex
attribute system

Docker Dockerfile
● Admittedly less powerful
● What you see is what you
get
● Environment variables
● Inspect environment at
any step
2. External Dependencies Cause Flaky Provisioning

Chef

Docker

● Once it’s in, it’s in.
● Dependencies are
● Even if you change an
external forever
image, only incremental
● Slower. You pay the price
changes need to be sent
on every node deployed
to hosts
● Under load? Want a new
node? Uh oh, the file
download is missing.
● Node creation needs to be
foolproof
● Or just use chef-solo to
bake images
3. Configuration Changes Create an Inconsistent State

Chef

Docker

● Configuration change? Try ● Ship configuration
changes as image deltas
to apply it to running node
● Nearly instant restarts
● Which changes restart
● Easier to be disciplined
which services?
and have each node be
● Removed something?
identical
○ knife ssh
○ tombstone
● Another reason to just bake
images
4. Developers! Developers! Developers!

Chef

Dockerfile

● Typo? Fix it and start from
● Error? Throw it all out.
the previous successful
● Every iteration/test takes:
command
○ Boot time
● Containers encourage
○ Every step
single-purpose instances
● Can’t test every host
(put your monitoring on
● Can’t test every
the host)
combination of cookbooks
○ Monitoring
○ Logging
Part 3. Whats next? What do we want?

What’s Next for Docker @ RelateIQ?
● Replace Chef search (simple node database in
elasticsearch)
● Monitoring via StatsD and/or Datadog
Wish List
● Dockerfile repo/trusted builds (mentioned on dockerdev)
● Centralized Docker host management
● Mac host (no more virtualbox!)
We’re hiring! https://www.relateiq.com/jobs.html

More Related Content

PPTX
Immutable infrastructure & Micro Services
Tomer Paz
 
PPTX
Immutable infrastructure with Docker and EC2
dotCloud
 
PDF
DockerCon EU 2015: Deploying and Managing Containers for Developers
Docker, Inc.
 
PPTX
John Engates Keynote at Dockercon 14
dotCloud
 
PDF
DCSF19 How To Build Your Containerization Strategy
Docker, Inc.
 
PDF
Docker at Spotify - Dockercon14
dotCloud
 
PPTX
DockerCon EU 2015: Placing a container on a train at 200mph
Docker, Inc.
 
PDF
Are VM Passé?
dotCloud
 
Immutable infrastructure & Micro Services
Tomer Paz
 
Immutable infrastructure with Docker and EC2
dotCloud
 
DockerCon EU 2015: Deploying and Managing Containers for Developers
Docker, Inc.
 
John Engates Keynote at Dockercon 14
dotCloud
 
DCSF19 How To Build Your Containerization Strategy
Docker, Inc.
 
Docker at Spotify - Dockercon14
dotCloud
 
DockerCon EU 2015: Placing a container on a train at 200mph
Docker, Inc.
 
Are VM Passé?
dotCloud
 

What's hot (20)

PPTX
DockerCon EU 2015: Speed Up Deployment: Building a Distributed Docker Registr...
Docker, Inc.
 
PDF
Activision's Skypilot: Delivering Amazing Game Experiences Through Containeri...
Docker, Inc.
 
PPTX
DockerCon Keynote Ben Golub
dotCloud
 
PDF
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
PDF
Dev with Docker WCPHX 2019
Maura Teal
 
PPTX
DevOps Practices @Pipedrive
Renno Reinurm
 
PDF
Why I wish I'd Heard of Docker when I was 12 - Finnian Anderson
Docker, Inc.
 
PDF
Building a smarter application Stack by Tomas Doran from Yelp
dotCloud
 
PDF
DockerDay2015: Docker Security
Docker-Hanoi
 
PPTX
Rancher presentation august 2017
Sebastiaan van Steenis
 
PDF
Living with microservices at Pipedrive
Renno Reinurm
 
PDF
DockerCon 2017 - General Session Day 1 - Solomon Hykes
Docker, Inc.
 
PPTX
DevFestMN 2017 - Learning Docker and Kubernetes with Openshift
Keith Resar
 
PPTX
Running Docker in Production - The Good, the Bad and The Ugly
Kontena, Inc.
 
PDF
Become a Docker Power User With Microsoft Visual Studio Code
Docker, Inc.
 
PDF
Docker based-Pipelines with Codefresh
Codefresh
 
PDF
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
Docker, Inc.
 
PDF
Docker?!?! But I'm a SysAdmin
Docker, Inc.
 
PDF
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
PPTX
DockerCon EU 2015: Docker Monitoring
Docker, Inc.
 
DockerCon EU 2015: Speed Up Deployment: Building a Distributed Docker Registr...
Docker, Inc.
 
Activision's Skypilot: Delivering Amazing Game Experiences Through Containeri...
Docker, Inc.
 
DockerCon Keynote Ben Golub
dotCloud
 
Docker worshop @Twitter - How to use your own private registry
dotCloud
 
Dev with Docker WCPHX 2019
Maura Teal
 
DevOps Practices @Pipedrive
Renno Reinurm
 
Why I wish I'd Heard of Docker when I was 12 - Finnian Anderson
Docker, Inc.
 
Building a smarter application Stack by Tomas Doran from Yelp
dotCloud
 
DockerDay2015: Docker Security
Docker-Hanoi
 
Rancher presentation august 2017
Sebastiaan van Steenis
 
Living with microservices at Pipedrive
Renno Reinurm
 
DockerCon 2017 - General Session Day 1 - Solomon Hykes
Docker, Inc.
 
DevFestMN 2017 - Learning Docker and Kubernetes with Openshift
Keith Resar
 
Running Docker in Production - The Good, the Bad and The Ugly
Kontena, Inc.
 
Become a Docker Power User With Microsoft Visual Studio Code
Docker, Inc.
 
Docker based-Pipelines with Codefresh
Codefresh
 
DockerCon EU 2015: Continuous Integration with Jenkins, Docker and Compose
Docker, Inc.
 
Docker?!?! But I'm a SysAdmin
Docker, Inc.
 
DCEU 18: Docker Containers in a Serverless World
Docker, Inc.
 
DockerCon EU 2015: Docker Monitoring
Docker, Inc.
 
Ad

Viewers also liked (14)

PPT
Performance and Scalability for Maps API Sites (Dev Fest '10 Mexico)
Ossama Alami
 
PDF
Vagrant
Rob Kinyon
 
PDF
Dockerffm meetup 20150113_networking
Andreas Schmidt
 
PPTX
pipework - Advanced Docker Networking
saba syake
 
PDF
Pipework: Software-Defined Network for Containers and Docker
Jérôme Petazzoni
 
PDF
Introduction to Docker (and a bit more) at LSPE meetup Sunnyvale
Jérôme Petazzoni
 
PDF
Building a network emulator with Docker and Open vSwitch
Goran Cetusic
 
PDF
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
DataStax Academy
 
PDF
Docker introduction
Julien Maitrehenry
 
PDF
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
PDF
Docker by Example - Basics
Ganesh Samarthyam
 
PPTX
Docker 101 - Nov 2016
Docker, Inc.
 
PDF
containerd and CRI
Docker, Inc.
 
PDF
Docker 101: Introduction to Docker
Docker, Inc.
 
Performance and Scalability for Maps API Sites (Dev Fest '10 Mexico)
Ossama Alami
 
Vagrant
Rob Kinyon
 
Dockerffm meetup 20150113_networking
Andreas Schmidt
 
pipework - Advanced Docker Networking
saba syake
 
Pipework: Software-Defined Network for Containers and Docker
Jérôme Petazzoni
 
Introduction to Docker (and a bit more) at LSPE meetup Sunnyvale
Jérôme Petazzoni
 
Building a network emulator with Docker and Open vSwitch
Goran Cetusic
 
Big Data Open Source Security LLC: Realtime log analysis with Mesos, Docker, ...
DataStax Academy
 
Docker introduction
Julien Maitrehenry
 
A Gentle Introduction To Docker And All Things Containers
Jérôme Petazzoni
 
Docker by Example - Basics
Ganesh Samarthyam
 
Docker 101 - Nov 2016
Docker, Inc.
 
containerd and CRI
Docker, Inc.
 
Docker 101: Introduction to Docker
Docker, Inc.
 
Ad

Similar to Docker @ RelateIQ Presentation (20)

PDF
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PROIDEA
 
PDF
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
PDF
Rails in docker
Andrew Klotz
 
PPTX
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
PPTX
Docking with Docker
University of Alabama at Birmingham
 
PDF
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
PDF
Real-World Docker: 10 Things We've Learned
RightScale
 
PPTX
Building Docker Containers @ Scale
lxfontes
 
PDF
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
PDF
Docker in everyday development
Justyna Ilczuk
 
PDF
Sandbox CI/CD Environments for Everyone [BADCamp 2018]
Leonid Makarov
 
PDF
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
PDF
Adventures in docker compose
LinkMe Srl
 
PPTX
Docker Compose: Docker Configuration for the Real World
Will Hall
 
ODP
DevAssistant, Docker and You
BalaBit
 
ODP
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios
 
PDF
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Puja Abbassi
 
PDF
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
PDF
Introduction of Docker and Docker Compose
Dr. Ketan Parmar
 
PDF
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Erica Windisch
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PROIDEA
 
Docker 0.11 at MaxCDN meetup in Los Angeles
Jérôme Petazzoni
 
Rails in docker
Andrew Klotz
 
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
Real-World Docker: 10 Things We've Learned
RightScale
 
Building Docker Containers @ Scale
lxfontes
 
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
Docker in everyday development
Justyna Ilczuk
 
Sandbox CI/CD Environments for Everyone [BADCamp 2018]
Leonid Makarov
 
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
Adventures in docker compose
LinkMe Srl
 
Docker Compose: Docker Configuration for the Real World
Will Hall
 
DevAssistant, Docker and You
BalaBit
 
Nagios Conference 2014 - Spenser Reinhardt - Detecting Security Breaches With...
Nagios
 
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Puja Abbassi
 
Introduction to Docker at the Azure Meet-up in New York
Jérôme Petazzoni
 
Introduction of Docker and Docker Compose
Dr. Ketan Parmar
 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Erica Windisch
 

Recently uploaded (20)

PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Doc9.....................................
SofiaCollazos
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Safe Software
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
cloud computing vai.pptx for the project
vaibhavdobariyal79
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
The Future of Artificial Intelligence (AI)
Mukul
 
Doc9.....................................
SofiaCollazos
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 

Docker @ RelateIQ Presentation

  • 1. 10/17/2013 - Docker @ RelateIQ - Scott Bessler & John Fiedler
  • 2. Docker @ RelateIQ @ Scott Bessler [email protected] @scottbessler John Fiedler [email protected] @johnfiedler Blog blog.relateiq.com RelateIQ Twitter @relateiq File Repo https://github.com/relateiq/docker_public
  • 3. Agenda ● Part 1 - What we did with Docker ● Part 2 - Why we want to replace Chef ● Part 3 - Future plans using Docker
  • 4. Part 1. Things were getting out of control... Bring on hack day! + + Hack Day! = =
  • 5. What we needed to build Docker Files Minimum Kafka MongoDB Redis Cassandra Zookeeper Elasticsearch Crushing IT Docker Files Storm Jetty Nginx + Private Docker Registry
  • 6. End product MAC OS X $ devenv start One Command! $ devenv-inner start Kafka VM Containers MongoDB Redis Cassandra Zookeeper ubuntu Elasticsearch
  • 7. Orchestration scripts devenv.sh (outer) [up|update|ssh] ● ● Controls Vagrant Controls inner script devenv-inner.sh (inner) [stop|start|kill|update|status|restart] ● Controls Docker containers update(){ start(){ apt-get update mkdir -p $APPS/zookeeper/data apt-get install -y lxc-docker mkdir -p $APPS/zookeeper/logs ZOOKEEPER=$(docker run docker pull server:4444/zookeeper -d docker pull server:4444/redis -p 2181:2181 docker pull server:4444/cassandra -v $APPS/zookeeper/logs:/logs docker pull server:4444/elasticsearch server:4444/zookeeper) docker pull server:4444/mongo echo "Started ZOOKEEPER in container $ZOOKEEPER" echo "Wiring containers together… " docker pull server:4444/kafka } kill/stop(){ (later slide) echo "Killing all docker containers:" docker ps | tail -n +2 |cut -d ' ' -f 1 | xargs docker kill }
  • 8. Dockerfile’s Dockerfile FROM server:4444/oracle-java7 Std Image RUN apt-get update RUN apt-get install -y git curl build-essential make gcc wget RUN cd /opt && wget http://apache.mirrors.pair.com/cassandra/1.2.9/apachecassandra-1.2.9-bin.tar.gz RUN cd /opt && tar zxf apache-cassandra-*.tar.gz RUN rm /opt/*.tar.gz RUN mv /opt/apache-cassandra-* /opt/cassandra RUN apt-get install -y lsof #!/bin/bash echo "Cassandra node configuration:" echo $CASS_SEEDS echo $CASS_TOKEN start.sh echo $CASS_LOCAL_IP HOST=`hostname` echo "127.0.0.1 $HOST" >> /etc/hosts /opt/cassandra/bin/cassandra -f ADD cassandra.yaml /opt/cassandra/conf/cassandra.yaml ADD cassandra-env.sh /opt/cassandra/conf/cassandra-env.sh ADD log4j-server.properties /opt/cassandra/conf/log4j-server.properties ADD start.sh /opt/cassandra/bin/start.sh ADD cassandra-topology.properties /opt/cassandra/conf/cassandra-topology. properties RUN chmod 755 /opt/cassandra/bin/start.sh RUN mkdir /logs ... VOLUME [ "/logs" ] ... EXPOSE 7000 …. CMD "/opt/cassandra/bin/start.sh"
  • 9. Networking - port forwarding Question: Dude, where’s mongo? Answer: Port forwarding Example: > Docker file expose 9999 (dockerfile) > Docker Machine localhost:27019 vagrant config.vm.forward_port 9999,27019 docker run -p 9999:27018 docker run -p 8000:9999 > VAGRANT config.vm.forward_port 27018, 8000 > localhost:8000 docker file expose 27018 MongoDB Tip: Always use the same port if you can Containers
  • 10. Networking - connecting two containers Question: Kafka: Dude, where’s Zookeeper? Answer: Pipework Machine vagrant https://github.com/jpetazzo/pipework Example: docker > startup the container KAFKA = docker run -e zooip=192.168.1.1 pipework br1 > Pipework pipework br1 $KAFKA 192.168.1.2 pipework br1 $ZOOKEEPER 192.168.1.1 (dockerfile) Zookeeper Tip: Use this for clustering Kafka 192.168.1.1 192.168.1.2 Containers
  • 11. Best practices What we found Machine *Abstraction ● ● ● ● Data Logs Don’t end with tailing End with foreground execution ● Start script for runtime configuration ● 42 layers, combine Dockerfile lines ● Up Vagrant RAM default VM /logs/mongo /data/mongo /logs/kafka /data/kafka *Standard Data and log dirs *Static IP MongoDB Kafka *Start Script *Foreground Execution *42 layers only Containers
  • 12. Chef 4 reasons why we want to replace Chef with Docker in prod
  • 13. 1. Dynamic Configuration Is Too Complex Chef ● Dynamic configuration through complex attribute system Docker Dockerfile ● Admittedly less powerful ● What you see is what you get ● Environment variables ● Inspect environment at any step
  • 14. 2. External Dependencies Cause Flaky Provisioning Chef Docker ● Once it’s in, it’s in. ● Dependencies are ● Even if you change an external forever image, only incremental ● Slower. You pay the price changes need to be sent on every node deployed to hosts ● Under load? Want a new node? Uh oh, the file download is missing. ● Node creation needs to be foolproof ● Or just use chef-solo to bake images
  • 15. 3. Configuration Changes Create an Inconsistent State Chef Docker ● Configuration change? Try ● Ship configuration changes as image deltas to apply it to running node ● Nearly instant restarts ● Which changes restart ● Easier to be disciplined which services? and have each node be ● Removed something? identical ○ knife ssh ○ tombstone ● Another reason to just bake images
  • 16. 4. Developers! Developers! Developers! Chef Dockerfile ● Typo? Fix it and start from ● Error? Throw it all out. the previous successful ● Every iteration/test takes: command ○ Boot time ● Containers encourage ○ Every step single-purpose instances ● Can’t test every host (put your monitoring on ● Can’t test every the host) combination of cookbooks ○ Monitoring ○ Logging
  • 17. Part 3. Whats next? What do we want? What’s Next for Docker @ RelateIQ? ● Replace Chef search (simple node database in elasticsearch) ● Monitoring via StatsD and/or Datadog Wish List ● Dockerfile repo/trusted builds (mentioned on dockerdev) ● Centralized Docker host management ● Mac host (no more virtualbox!)