5. (Pain) = n * m
• Every developer wastes almost a day to configure
his machine
• What about tester’s machine?
• Hot patches during release nights!
n = size of team + staging + production
m = size of project
6.
7.
8.
9. Matrix from Hell!
Django ? ? ? ?
PostgreSQL ? ? ? ? ?
Redis ? ? ? ? ?
Big Data ? ? ? ? ?
Message Queue ? ? ? ? ?
Developer
Laptop
QA
Laptop
Staging
Server
Prod. on
Server
Prod. on
Cloud
15. Start Django project
$ fig run web django-admin.py startproject example .
$ ls
Dockerfile example fig.yml manage.py
requirements.txt
$ ls example
__init__.py settings.py urls.py wsgi.py
23. Polls App
$ fig run web python manage.py makemigrations polls
$ fig run web python manage.py sqlmigrate polls 0001
$ fig run web python manage.py sqlmigrate polls 0001
24. Running the app
#!/bin/sh
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
• Running the app became a bit more complex
• We need to make sure that models are migrated
• create run_web.sh
32. Run
• -d = Daemon mode
• -f = Specify fig file
$ fig up -d -f fig-production.yml
33. Docker Internals
• Images
• Read-only templates
• Clone of the system with installed apps + code
• Containers
• Running instance of an image
• Isolated file system and ports
• Registeres
• Host for Images
• Dockerhub,com
37. Docker Machine
$ docker-machine create -d virtualbox dev
$ docker-machine create -d digitalocean --
digitalocean-access-token=... staging
$ docker-machine ls
NAME ACTIVE DRIVER STATE URL
dev virtualbox Running tcp://192.168.99.108:2376
staging * digitalocean Running tcp://104.236.37.134:2376
38. Docker Swarm
• Clustering for Dockerized distributed apps
• Selects a docker demon for your containers
(created by Docker machine)
39. Docker Compose
• Docker bought fig!
• No need to install two tools in future
• Almost same yaml syntax
40. Fun with Docker
• Explore dockerized apps at dockerhub.com with no
installation hassle!
• docker run mongo
• docker run --rm -v "$PWD" -p 4000:4000 grahamc/jekyll
• docker run -it --rm williamyeh/scala
• Some cool aliases here: http://github.com/tabdulradi/
docker-fish-functions
41. Tamer M Abdul-Radi
Software Engineer
twitter.com/tabdulradi
github.com/tabdulradi
abdulradi.com
Thanks
Eslam ElHusseiny
Systems Engineer
twitter.com/EslamElHusseiny
github.com/EslamElHusseiny
eslamelhusseiny.wordpress.com
http://github.com/Kiosk12/docker-django-demo