Upgrade to Pro — share decks privately, control downloads, hide ads and more …

12 months of Production Time with Docker

Gerhard Lazu
September 12, 2014

12 months of Production Time with Docker

Docker is fast, deterministic, and delivers really well on promises, but it’s just a small piece of the puzzle. This talk is about the other missing pieces for a successful production environment run entirely in Docker containers, on dedicated hardware, with no PXE magic.

Talk given at the first Docker conference in London, Container Camp, 12 September 2014

http://container.camp/talks/12-months-of-production-time-with-docker/

Gerhard Lazu

September 12, 2014
Tweet

More Decks by Gerhard Lazu

Other Decks in Technology

Transcript

  1. 12 months of
    Production Time
    with

    View Slide

  2. Production
    Always raw hardware for
    best performance.

    View Slide

  3. Staging
    Raw hardware for quick
    feedback loops.

    View Slide

  4. Fast. Repeatable. Easy.

    View Slide

  5. Fast. Repeatable. Easy.
    But it only solves 1
    problem well, as all real
    Unix tools do.

    View Slide

  6. [x] Gerhard
    [x] Platform

    View Slide

  7. [x] Gerhard
    [x] Platform

    View Slide

  8. WWGD?
    Does things as I would
    do them: in a shell, over
    SSH.

    View Slide

  9. Declarative nature
    Easy to follow & debug

    View Slide

  10. Thin abstractions
    Fast feedback

    View Slide

  11. Batteries included
    Point and... play!

    View Slide

  12. $ ./bin/p
    $ p
    $ p -t docker,registry
    $ p -t juicer
    $ p -t focus -l disco -vvv

    View Slide

  13. $ ./bin/p
    $ p
    $ p -t docker,registry
    $ p -t juicer
    $ p -t focus -l disco -vvv

    View Slide

  14. $ ./bin/p
    $ p
    $ p -t docker,registry
    $ p -t juicer
    $ p -t focus -l disco -vvv

    View Slide

  15. $ ./bin/p
    $ p
    $ p -t docker,registry
    $ p -t juicer
    $ p -t focus -l disco -vvv

    View Slide

  16. $ ./bin/p
    $ p
    $ p -t docker,registry
    $ p -t juicer
    $ p -t focus -l disco -vvv

    View Slide

  17. $ which gp
    > aliased to git push
    $ which d
    > aliased to docker
    $ which dr
    > aliased to docker run

    View Slide

  18. $ which gp
    > aliased to git push
    $ which d
    > aliased to docker
    $ which dr
    > aliased to docker run

    View Slide

  19. $ which gp
    > aliased to git push
    $ which d
    > aliased to docker
    $ which dr
    > aliased to docker run

    View Slide

  20. The Gerhard Platform
    Simple solutions to
    production Docker
    challenges

    View Slide

  21. $ which gp
    > aliased to git push
    $ which d
    > aliased to docker
    $ which dr
    > aliased to docker run

    View Slide

  22. Image management
    dr registry
    localhost:5000/nginx:1.6.1

    View Slide

  23. Service dependencies
    ansible-playbook
    runsv

    View Slide

  24. Container supervision
    dr --restart
    runsv

    View Slide

  25. Log management
    dr -v /mnt/log/nginx
    svlogd

    View Slide

  26. Raw network I/O
    dr --net host

    View Slide

  27. Raw disk I/O
    dr -v /mnt/mysql
    LVM... with snapshots o.O

    View Slide

  28. Service discovery
    dr -p 127.0.0.1:60000:3000
    SO_REUSEPORT

    View Slide

  29. Service discovery
    dr -p 127.0.0.1:60000:3000
    SO_REUSEPORT

    View Slide

  30. Firewall
    dr -p 127.0.0.1::3306
    iptables & ferm

    View Slide

  31. Config templating
    dr -v /opt/nginx/conf
    pkill -HUP -f nginx.*master

    View Slide

  32. App runtimes
    localhost:5000/ruby:2.1.2
    dr -v /mnt/[app]

    View Slide

  33. Monitoring
    dr --privileged
    New Relic & Linode Longview

    View Slide

  34. Sysadmin tools
    dr --privileged
    htop, ntop, iptraf, dstat, vnstat ...

    View Slide

  35. The Gerhard Platform
    Just how fast is it?
    Very.

    View Slide

  36. The Gerhard Platform
    Just how fast is it?
    Very

    View Slide

  37. 5 minutes
    14.04 base provision

    View Slide

  38. 10 minutes
    Cold production setup

    View Slide

  39. 2.5 minutes
    Warm production setup

    View Slide

  40. 15 minutes
    Re-create production

    View Slide

  41. Thank you Docker
    For enabling my next
    generation
    Gerhard Platform

    View Slide

  42. Thank you Ansible
    For letting me learn and
    iterate quickly, even in
    production

    View Slide

  43. Perfect software is the
    one that you don't
    know well enough.

    View Slide

  44. gerhardlazu

    View Slide