You are on page 1of 13

Docker at eBay

Ted Dziuba
Senior Member of Technical Staff
eBay Now
tdziuba@ebay.com
Wednesday, July 31, 13

Virtualenvs Broken Promises: Encapsulation

ted@workstation:~$ pip install lxml

This will fail spectactularly on a clean Ubuntu machine.

Docker at eBay
Wednesday, July 31, 13

Virtualenvs Broken Promises: Encapsulation


Works on My Machine

Works on Our Machines

Works in Production

ted@workstation:~$ sudo apt-get install python-dev libxml2-dev libxslt1-dev

Get your OS-level dependencies first, of course.

Docker at eBay
Wednesday, July 31, 13

Getting There with Vagrant


Works on My Machine

Works on Our Machines

Works in Production

install_cmd = apt-get update; apt-get install -y python-dev \


libxml2-dev libxslt1-dev; pip install -r requirements.txt;

config.vm.provision :shell, :inline => install_cmd

Docker at eBay
Wednesday, July 31, 13

You Cant Ship a Vagrantfile


Vagrant VM

Production
Load Balancer

Load Balancer

Load Balancer

Database

Application

Memcache

Database

Application

Memcache

Application

Database

Redis

Database

Memcache
Load Balancer

Memcache

RabbitMQ

Load Balancer

Memcache

RabbitMQ

Memcache

Redis

RabbitMQ

Memcache

Redis

RabbitMQ

Memcache

Docker at eBay
Wednesday, July 31, 13

Production never gets less containerized.

Docker at eBay
Wednesday, July 31, 13

Containerizing Development in eBay Now

FROM teddziuba/python2.7

Application Dockerfile

Containerized DB

Django manage.py
wrapper

ADD requirements.txt /tmp/requirements.txt


RUN pip install -r /tmp/requirements.txt

ted@workstation:~$ docker run -d teddziuba/


postgresql-development-9.2

ted@workstation:~$ docker run -t -i -p


8000:8000 -e DATABASE_URL=... -v /path/to/
src:/app-dev ebaynow python /app-dev/
manage.py runserver 0.0.0.0:8000

Docker at eBay
Wednesday, July 31, 13

Containerize service dependencies and address them as


environment variables.

Docker at eBay
Wednesday, July 31, 13

Development Containers Go Straight to CI


Jenkins Test Runner
Integration Test Case
Container

Application Container

Thing Under Test

Database Container

Docker at eBay
Wednesday, July 31, 13

Run database driven tests in parallel.

Docker at eBay
Wednesday, July 31, 13

10

Docker in Production at eBay (Coming Soon)


My Workstation

Jenkins

Production

Integration Test Case Container

Load Balancer

Application Container

Thing Under Test

Thing Serving HTTP Traffic

Database Container

Database Container

Production Database

Emacs

Docker at eBay
Wednesday, July 31, 13

11

Works on My Machine

Works on Our Machines

Works in Production

Docker at eBay
Wednesday, July 31, 13

12

Questions?

Docker at eBay
Wednesday, July 31, 13

13

You might also like