Slide 1

Slide 1 text

Python Apps & Docker @pygotham 2014

Slide 2

Slide 2 text

Matt Wright @mattupstate Software/Ops Engineer @ChatID ● Python, Lua, CoffeeScript ● Flask, Prosody, Backbone, Angular Open Source ● Author: Flask-Security, Flask-JWT, ... ● Contributor: Ansible, Flask ● Member: metaflask

Slide 3

Slide 3 text

What’s all the fuss about?

Slide 4

Slide 4 text

“... an open platform for developers and sysadmins to build, ship, and run distributed applications.” http://docker.com/whatisdocker Docker:

Slide 5

Slide 5 text

Images A stateless, read-only collection of “layers” joined together via a union filesystem. Containers A stateful instance of an image in which one or more processes are running or have exited Docker: Concepts

Slide 6

Slide 6 text

Docker: Components Docker Engine A portable, lightweight system level daemon that manages images and containers Docker Hub A web service for distributing images and enabling automated workflows

Slide 7

Slide 7 text

Docker Hub Server Docker Engine Docker CLI Containers Images Docker: Birds Eye View Repository Images Repository Images Repository Images Repository Images

Slide 8

Slide 8 text

● Development Environments ● Application Deployment ● Continuous Integration ● Continuous Delivery ● Platform-as-a-Service (PaaS) Docker: Use Cases

Slide 9

Slide 9 text

Tooling Kubernetes Marathon maestro-ng Shipyard fig Platforms Elastic Beanstalk CoreOS flynn.io deis.io Docker: Landscape SaaS circleci.com shippable.com drone.io quay.io and many more (to come) ...

Slide 10

Slide 10 text

boot2docker https://coderwall.com/p/fvfjyg

Slide 11

Slide 11 text

+

Slide 12

Slide 12 text

Development Environments

Slide 13

Slide 13 text

● OS ● System libraries ● Python dependencies ● Database, cache, etc Dev Env: Components

Slide 14

Slide 14 text

● Constantly change ● Never truly consistent ● Miscommunication (Ops vs. Devs) ● “Drift” Dev Env: Problems

Slide 15

Slide 15 text

● README ● Stacks (LAMP, XAMP) ● Virtual Machines ● Vagrant + (Chef | Puppet | Ansible) Dev Envs: Before

Slide 16

Slide 16 text

● Easy to change and share ● Always consistent ● 100% Isolated ● Single authority ● Production ready! Dev Envs: Docker!

Slide 17

Slide 17 text

Dockerfile

Slide 18

Slide 18 text

Testing

Slide 19

Slide 19 text

Fig $ pip install fig

Slide 20

Slide 20 text

Production Ready

Slide 21

Slide 21 text

● Be skeptical of Docker dogma ● Keep secrets out of env vars ● Don’t use Docker for everything ● Design images carefully Docker Tips

Slide 22

Slide 22 text

Thank You! mattupstate.com gittip.com/mattupstate github.com/mattupstate twitter.com/mattupstate