Bridget Kromhout gave a presentation on how her company DramaFever uses Docker for streaming video. They run Docker in production and have seen peak loads of tens of thousands of requests per second. They use Docker, AWS, and other technologies to build and deploy images automatically and scale their infrastructure elastically. Bridget discussed challenges they faced with Docker and solutions like changing the storage driver and registry configuration to address issues with builds and image pulls failing.
Report
Share
Report
Share
1 of 44
Download to read offline
More Related Content
Lights, Camera, Docker: Streaming Video at DramaFever
10. docker options
# this goes in /etc/default/docker to control
docker's upstart config
DOCKER_OPTS="--graph=/mnt/docker --insecure-
registry=localhost-alias.com:5000"
● localhost-alias.com in DNS with A record to 127.0.0.1
● OS X /etc/hosts: use the boot2docker host-only network IP
@bridgetkromhout
14. 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
23. #!/bin/bash
cat <<EOF > /etc/init/django.conf
description "Run Django containers for www"
start on started docker-reg
stop on runlevel [!2345] or stopped docker
respawn limit 5 30
[...]
replacing 100s of lines of userdata...
@bridgetkromhout
24. #!/bin/bash
# upstart configs are now created by chef
rm /etc/chef/client.pem
mkdir -p /var/log/chef
chef-client -r 'role[rolename]' -E 'environment' -L
/var/log/chef/chef-client.log
...with a chef-client run.
@bridgetkromhout
26. docker run
<% if @docker_rm == true -%>
--rm
<% end %>
<% @docker_env.each do |k, v| -%>
-e <%= k %>=<%= v %>
<% end %>
<% @docker_port.each do |p| -%>
-p <%= p %>
<% end %>
upstart
template
@bridgetkromhout
29. recipe using LWRP
base_docker node['www']['django']['name'] do
command node['www']['django']['command']
env node['www'][service]['django'][env]['env']
image node['www']['django']['image']
port node['www'][service]['django'][env]['port']
tag node['www'][service]['django'][env]['tag']
type node['www']['django']['type']
end
@bridgetkromhout
38. 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
39. registry rewrite just landed!
DOCKER_OPTS="--graph=/mnt/docker --
insecure-registry=local-repo-alias.
com:5000 -e STORAGE_REDIRECT=true"
until we upgrade to 2.0, our “flate” workaround:
@bridgetkromhout
43. $ 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