SlideShare a Scribd company logo
@bridgetkromhout
Docker in Production
Reality, Not Hype
Bridget Kromhout
@bridgetkromhout
Bridget Kromhout
Operations Engineer
@DramaFever
Minneapolis, Minnesota
@devopsdays
@devopsdaysMSP
@arresteddevops
bridgetkromhout.com
@bridgetkromhout
K-dramas since 2009. Docker in prod since October 2013.
@bridgetkromhout
architecture
● All services in AWS
● Python (Django) main website
● Go microservices (video analytics ingest, on-the
fly image processing, bookmarking…)
● Upstreams routed via nginx
● Celery + SQS for async tasks
@bridgetkromhout
scale
● Streaming delivery through Akamai
● peak load at 10s of thousands of
requests per second to the website
● The sine wave has a 10-20x differential
throughout the week
@bridgetkromhout
Why Docker?
consistent development repeatable deployment
How?
not:
a tutorial
but:
repeatable
@bridgetkromhout
private registry:
the official party line
https://github.com/docker/docker-
registry#quick-start
S3 is a storage engine option
but… a central registry server didn’t scale well
for us
@bridgetkromhout
private registry: dramafever
@bridgetkromhout
# this goes in /etc/default/docker to control
docker's upstart config
DOCKER_OPTS="--graph=/mnt/docker --insecure-
registry=local-repo-alias.com:5000"
● local-repo-alias.com in DNS with A record to 127.0.0.1
● OS X /etc/hosts: use the boot2docker host-only network IP
registry upstart
docker pull public_registry_image
docker run -p 5000:5000 --name registry 
-v /etc/docker-reg:/registry-conf 
-e DOCKER_REGISTRY_CONFIG=/registry-conf/config.yml 
public_registry_image
@bridgetkromhout
config.yml
s3_region: us-east-1
s3_access_key: <aws-accesskey>
s3_secret_key: <aws-secretkey>
s3_bucket: <bucketname>
standalone: true
@bridgetkromhout
what even is flate?!
Pulling repository local-repo-alias.com:5000/www
4dda2b433370: Error pulling image (prod) from
local-repo-alias.com:5000/www, flate: corrupt
input before offset 54393671 flate: corrupt
input before offset 54393671
d497ad3926c8: Error downloading dependent layers
2014/12/07 02:34:54 Error pulling image (prod)
from local-repo-alias.com:5000/www, flate:
corrupt input before offset 54393671
@bridgetkromhout
registry rewrite coming!
DOCKER_OPTS="--graph=/mnt/docker --
insecure-registry=local-repo-alias.
com:5000 -e STORAGE_REDIRECT=true"
...until we get to the promised go lan(d|g), there’s a
workaround for the flate errors we’re seeing:
@bridgetkromhout
Achievement
unlocked:
distributed
private
Docker
registry
@bridgetkromhout
@bridgetkromhout
Next up:
build pipeline
starring
everyone’s
favorite butler
weekly base builds
FROM local-repo-alias.com:5000/www-base
● include infrequently-changing
dependencies
○ ubuntu packages
○ pip requirements
○ wheels
● other builds can start from these images
(so they’re faster):
@bridgetkromhout
sudo docker build -t="a12fbdc" .
sudo docker run -i -t -w /var/www -e DJANGO_TEST=1 --
name test.a12fbdc a12fbdc py.test -s
sudo docker tag a12fbdc local-repo-alias.com:
5000/www:'dev'
sudo docker push local-repo-alias.com:5000/www:'dev'
@bridgetkromhout
www-master build
2014/10/30 21:35:31 Error getting container init rootfs
b528d54a0458a8cd8a798309930adb45cb5e1a7430e981e0f
3108f86386aab67 from driver devicemapper: open
/dev/mapper/docker-9:127-14024705-
b528d54a0458a8cd8a798309930adb45cb5e1a7430e981e0f
3108f86386aab67-init: no such file or directory
make: *** [build-django] Error 1
Build step 'Execute shell' marked build as failure
@bridgetkromhout
breaking builds
https://wiki.jenkins-ci.org/display/JENKINS/Naginator+Plugin
@bridgetkromhout
@bridgetkromhout
Retry the build…
...only if a specific regex appears
@bridgetkromhout
useful for unattended
base builds
need to change how it
reports to Slack
@bridgetkromhout
tag for staging
tag for prod
out of ELB
restart upstart
back in ELB
Ship it!
What
about
local
development?
@bridgetkromhout
before summer 2014
Vagrant for local development
chef-solo provisioner
17 minutes to install everything
@bridgetkromhout
now: boot2docker
devs pull down images built on jenkins
mysql image is built with fixtures
can run master or qa image (or even prod)
can build new local images from Dockerfiles
@bridgetkromhout
local registry for dev
docker run -d -p 5000:5000 --name
docker-reg -v ${DFHOME}:${DFHOME} -e
DOCKER_REGISTRY_CONFIG=${DFHOME}
/config/docker-registry/config.yml
public_registry_image
@bridgetkromhout
$ boot2docker ssh date -u
Mon Nov 24 16:09:02 UTC 2014
$ date -u
Tue Nov 25 01:43:49 UTC 2014
@bridgetkromhout
time is what turns kittens into cats
S3 requires clock sync
$ docker pull local-repo-alias.com:5000/mysql
Pulling repository local-repo-alias.com:5000/mysql
2014/11/24 19:44:31 HTTP code: 500
$ boot2docker ssh sudo date --set "$(env
TZ=UTC date '+%F %H:%M:%S')"
@bridgetkromhout
Devs can use their preferred editing environment:
-v ${DFHOME}/www:/var/www
We still want logs, too, so we expose those for the dev here:
-v ${DFHOME}/www/run:/var/log
volume mounting & our fork
@bridgetkromhout
Until 1.3 we ran a forked boot2docker
We needed to mount local files into the VM
containerizing front-end
useful for building front-end apps on Jenkins
also allows consistent testing
RUN apt-get install -y nodejs nodejs-legacy npm
RUN npm install -g grunt-cli@0.1.13
RUN npm install -g bower@1.3.8
RUN npm install -g phantomjs@1.9.7-14
ADD bower.json /var/www/dependencies/bower.json
RUN cd /var/www/dependencies && bower install --
allow-root
--config.interactive=false --force
@bridgetkromhout
@bridgetkromhout
django:
image: local-repo-alias.com:5000/www:dev
ports:
- "8000:8000"
links:
- mysql
- redis
environment:
- PYTHONPATH=/var/local
- DJANGO_ENVIRON=LOCAL
- DB_PORT_3306_TCP_ADDR=mysql
command: /var/local/config/local/start-django-local
volumes:
- ${DFHOME}/www/run:/var/log
- ${DFHOME}/www:/var/local
mysql:
image: local-repo-alias.com:5000/mysql:dev
expose:
- "3306:3306"
for persistent instances
# remove stopped containers
@daily docker rm `docker ps -aq`
# remove images tagged "none"
@daily docker rmi `sudo docker images | grep none
| awk -F' +' '{print $3}'`
@bridgetkromhout
failure modes
cron zombies
out of memory errors
race conditions
@bridgetkromhout
what isolation?
-v /var/log/containers:/var/log
@bridgetkromhout
Host instances moving into
ami factory
@bridgetkromhout
through a container darkly: monitoring
@bridgetkromhout
containers building
(lighter) containers
easier with
statically linked
binaries
go microservices
android apk
@bridgetkromhout
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
local-repo-alias.com:5000/mysql dev b0dc5885f767 2 days ago 905.9 MB
local-repo-alias.com:5000/www dev 82cda604a4f1 2 days ago 1.092 GB
local-repo-alias.com:5000/micro local bed20dc84ea1 4 days ago 10.08 MB
google/golang 1.3 e3934c44b8e4 2 weeks ago 514.3 MB
public_registry_image 0.6.9 11299d377a9e 6 months ago 454.5 MB
scratch latest 511136ea3c5a 18 months ago 0 B
$
ever-smaller images
@bridgetkromhout
@bridgetkromhout
Thank you!

More Related Content

PDF
Docker in Production: Reality, Not Hype
bridgetkromhout
 
PDF
Drone CI/CD Platform
Bo-Yi Wu
 
PDF
Drone 1.0 Feature
Bo-Yi Wu
 
PDF
"Wix Serverless from inside", Mykola Borozdin
Fwdays
 
PDF
Ci For The Web 2.0 Guy Or Gal
Chad Woolley
 
PDF
Docker 導入:障礙與對策
William Yeh
 
PDF
Ondřej Procházka - Deployment podle Devel.cz
Develcz
 
PPTX
JFrog container registry - DevOps extravaganza
Batel Zohar Tova
 
Docker in Production: Reality, Not Hype
bridgetkromhout
 
Drone CI/CD Platform
Bo-Yi Wu
 
Drone 1.0 Feature
Bo-Yi Wu
 
"Wix Serverless from inside", Mykola Borozdin
Fwdays
 
Ci For The Web 2.0 Guy Or Gal
Chad Woolley
 
Docker 導入:障礙與對策
William Yeh
 
Ondřej Procházka - Deployment podle Devel.cz
Develcz
 
JFrog container registry - DevOps extravaganza
Batel Zohar Tova
 

What's hot (19)

PDF
Devfest 2021' - Artifact Registry Introduction (Taipei)
KAI CHU CHUNG
 
PDF
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
tdc-globalcode
 
PDF
Google App Engine: Basic
KAI CHU CHUNG
 
PDF
Introduction to Express and Grunt
Peter deHaan
 
PDF
Workshop - Golang language
Vincent Composieux
 
PPTX
Docker and fig for dev
pranas_algoteq
 
PDF
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
PPTX
Grunt - The JavaScript Task Runner
Mohammed Arif
 
PPTX
drone continuous Integration
Bo-Yi Wu
 
PDF
Gitlab - Creating C++ applications with Gitlab CI
Uilian Ries
 
PDF
Docker as development environment
Bruno de Lima e Silva
 
PDF
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
KAI CHU CHUNG
 
PDF
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Alessandro Nadalin
 
KEY
20111018 1st lt_kom
Kensaku Komatsu
 
PDF
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
KAI CHU CHUNG
 
PDF
Bower & Grunt - A practical workflow
Riccardo Coppola
 
PPTX
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
PDF
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
PDF
容器化後,持續交付不可缺的敲門磚 - Helm
Hung-Yen Chen
 
Devfest 2021' - Artifact Registry Introduction (Taipei)
KAI CHU CHUNG
 
TDC2018SP | Trilha Containers - CI/CD com Docker e Drone
tdc-globalcode
 
Google App Engine: Basic
KAI CHU CHUNG
 
Introduction to Express and Grunt
Peter deHaan
 
Workshop - Golang language
Vincent Composieux
 
Docker and fig for dev
pranas_algoteq
 
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
KAI CHU CHUNG
 
Grunt - The JavaScript Task Runner
Mohammed Arif
 
drone continuous Integration
Bo-Yi Wu
 
Gitlab - Creating C++ applications with Gitlab CI
Uilian Ries
 
Docker as development environment
Bruno de Lima e Silva
 
如何透過 Go-kit 快速搭建微服務架構應用程式實戰
KAI CHU CHUNG
 
Deploying 3 times a day without a downtime @ Rocket Tech Summit in Berlin
Alessandro Nadalin
 
20111018 1st lt_kom
Kensaku Komatsu
 
Dev fest 2020 taiwan how to debug microservices on kubernetes as a pros (ht...
KAI CHU CHUNG
 
Bower & Grunt - A practical workflow
Riccardo Coppola
 
Docker at Monoco.jp (LinkedIn)
Akhmad Fathonih
 
Gitlab ci e kubernetes, build test and deploy your projects like a pro
sparkfabrik
 
容器化後,持續交付不可缺的敲門磚 - Helm
Hung-Yen Chen
 
Ad

Similar to Docker in Production: Reality, Not Hype - DevOps Chicago (20)

PDF
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
PDF
Docker in production: reality, not hype (OSCON 2015)
bridgetkromhout
 
PDF
Lights, Camera, Docker: Streaming Video at DramaFever
bridgetkromhout
 
PDF
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PROIDEA
 
PDF
Docker in everyday development
Justyna Ilczuk
 
PDF
Learning Docker with Thomas
Thomas Tong, FRM, PMP
 
PDF
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
PDF
Adventures in docker compose
LinkMe Srl
 
PPTX
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
PDF
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
PPTX
Real World Experience of Running Docker in Development and Production
Ben Hall
 
PDF
DCEU 18: Developing with Docker Containers
Docker, Inc.
 
PDF
Docker and IBM Integration Bus
Geza Geleji
 
PDF
Clustering Docker with Docker Swarm on openSUSE
Saputro Aryulianto
 
PPTX
Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Radulescu Adina-Valentina
 
PDF
How to create your own hack environment
Sumedt Jitpukdebodin
 
PPTX
Docker Enterprise Workshop - Technical
Patrick Chanezon
 
PDF
Securité des container
Rachid Zarouali
 
PPTX
Docking with Docker
University of Alabama at Birmingham
 
PDF
Docker primer and tips
Samuel Chow
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
bridgetkromhout
 
Docker in production: reality, not hype (OSCON 2015)
bridgetkromhout
 
Lights, Camera, Docker: Streaming Video at DramaFever
bridgetkromhout
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
PROIDEA
 
Docker in everyday development
Justyna Ilczuk
 
Learning Docker with Thomas
Thomas Tong, FRM, PMP
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
謝 宗穎
 
Adventures in docker compose
LinkMe Srl
 
Deploying Windows Containers on Windows Server 2016
Ben Hall
 
Ruby microservices with Docker - Sergii Koba
Ruby Meditation
 
Real World Experience of Running Docker in Development and Production
Ben Hall
 
DCEU 18: Developing with Docker Containers
Docker, Inc.
 
Docker and IBM Integration Bus
Geza Geleji
 
Clustering Docker with Docker Swarm on openSUSE
Saputro Aryulianto
 
Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Radulescu Adina-Valentina
 
How to create your own hack environment
Sumedt Jitpukdebodin
 
Docker Enterprise Workshop - Technical
Patrick Chanezon
 
Securité des container
Rachid Zarouali
 
Docker primer and tips
Samuel Chow
 
Ad

More from bridgetkromhout (20)

PDF
An introduction to Helm - KubeCon EU 2020
bridgetkromhout
 
PDF
Join Our Party: The Cloud Native Adventure Brigade (Kubernetes Belgium 2019)
bridgetkromhout
 
PDF
devops, distributed (devopsdays Ghent 2019)
bridgetkromhout
 
PDF
Join Our Party: The Cloud Native Adventure Brigade (devopsdays Philly 2019)
bridgetkromhout
 
PDF
Join Our Party: The Cloud Native Adventure Brigade (TCSW 2019)
bridgetkromhout
 
PDF
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
bridgetkromhout
 
PDF
Kubernetes for the Impatient (devopsdays Cape Town 2019)
bridgetkromhout
 
PDF
Join Our Party: The Cloud Native Adventure Brigade (OSS 2019)
bridgetkromhout
 
PDF
Helm 3: Navigating To Distant Shores (OSS NA 2019)
bridgetkromhout
 
PDF
Helm 3: Navigating to Distant Shores (OSCON 2019)
bridgetkromhout
 
PDF
Kubernetes for the Impatient (Velocity San Jose 2019)
bridgetkromhout
 
PDF
Community projects inform enterprise products (Velocity San Jose 2019)
bridgetkromhout
 
PDF
Helm 3: Navigating to Distant Shores (KubeCon EU 2019)
bridgetkromhout
 
PDF
Kubernetes Operability Tooling (GOTO Chicago 2019)
bridgetkromhout
 
PDF
Kubernetes Operability Tooling (Minnebar 2019)
bridgetkromhout
 
PDF
Livetweeting Tech Conferences - SREcon Americas 2019
bridgetkromhout
 
PDF
Kubernetes Operability Tooling (devopsdays Seattle 2019)
bridgetkromhout
 
PDF
Kubernetes Operability Tooling (LEAP 2019)
bridgetkromhout
 
PDF
Day 2 Kubernetes - Tools for Operability (KubeCon)
bridgetkromhout
 
PDF
Cloud, Containers, Kubernetes (YOW Melbourne 2018)
bridgetkromhout
 
An introduction to Helm - KubeCon EU 2020
bridgetkromhout
 
Join Our Party: The Cloud Native Adventure Brigade (Kubernetes Belgium 2019)
bridgetkromhout
 
devops, distributed (devopsdays Ghent 2019)
bridgetkromhout
 
Join Our Party: The Cloud Native Adventure Brigade (devopsdays Philly 2019)
bridgetkromhout
 
Join Our Party: The Cloud Native Adventure Brigade (TCSW 2019)
bridgetkromhout
 
Increasing Reliability via Helm Pre-Release Checks (Helm Summit 2019)
bridgetkromhout
 
Kubernetes for the Impatient (devopsdays Cape Town 2019)
bridgetkromhout
 
Join Our Party: The Cloud Native Adventure Brigade (OSS 2019)
bridgetkromhout
 
Helm 3: Navigating To Distant Shores (OSS NA 2019)
bridgetkromhout
 
Helm 3: Navigating to Distant Shores (OSCON 2019)
bridgetkromhout
 
Kubernetes for the Impatient (Velocity San Jose 2019)
bridgetkromhout
 
Community projects inform enterprise products (Velocity San Jose 2019)
bridgetkromhout
 
Helm 3: Navigating to Distant Shores (KubeCon EU 2019)
bridgetkromhout
 
Kubernetes Operability Tooling (GOTO Chicago 2019)
bridgetkromhout
 
Kubernetes Operability Tooling (Minnebar 2019)
bridgetkromhout
 
Livetweeting Tech Conferences - SREcon Americas 2019
bridgetkromhout
 
Kubernetes Operability Tooling (devopsdays Seattle 2019)
bridgetkromhout
 
Kubernetes Operability Tooling (LEAP 2019)
bridgetkromhout
 
Day 2 Kubernetes - Tools for Operability (KubeCon)
bridgetkromhout
 
Cloud, Containers, Kubernetes (YOW Melbourne 2018)
bridgetkromhout
 

Docker in Production: Reality, Not Hype - DevOps Chicago