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

Docker: From Dev to Prod [JavaSkop 2015]

Docker: From Dev to Prod [JavaSkop 2015]

A quick introduction to the docker technology followed by where the road to Docker may head to: Continuous Deployment, DevOps, High Availability Setups.

Christian Mäder

December 13, 2015
Tweet

More Decks by Christian Mäder

Other Decks in Programming

Transcript

  1. Chris @cimnine Disclaimer: The opinions expressed are those of the

    speaker and do not reflect opinions of any other person, company or agency.
  2. Chris @cimnine Disclaimer: The opinions expressed are those of the

    speaker and do not reflect opinions of any other person, company or agency.
  3. Chris @cimnine Disclaimer: The opinions expressed are those of the

    speaker and do not reflect opinions of any other person, company or agency.
  4. orange lines are data flow and blue lines are control

    flow VCS DEV DEV CI CI Integr. Integr. Pre Prod Pre Prod Prod Prod Dev
  5. VCS DEV DEV CI CI Integr. Integr. Pre Prod Pre

    Prod Prod Prod Dev orange lines are data flow and blue lines are control flow
  6. VCS DEV DEV CI CI Integr. Integr. Pre Prod Pre

    Prod Prod Prod Dev orange lines are data flow and blue lines are control flow
  7. VCS DEV DEV CI CI Integr. Integr. Pre Prod Pre

    Prod Prod Prod Dev Ops orange lines are data flow and blue lines are control flow
  8. VCS DEV DEV CI CI Integr. Integr. Dev Ops Pre-

    Prod Prod orange lines are data flow and blue lines are control flow
  9. VCS DEV DEV CI CI Dev orange lines are data

    flow and blue lines are control flow
  10. VCS DEV DEV CI CI Dev git push orange lines

    are data flow and blue lines are control flow
  11. VCS DEV DEV CI CI Dev post-commit hook orange lines

    are data flow and blue lines are control flow
  12. VCS DEV DEV CI CI Integr. Integr. Dev ? orange

    lines are data flow and blue lines are control flow
  13. VCS DEV DEV CI CI Repository Integr. Integr. Dev orange

    lines are data flow and blue lines are control flow
  14. VCS DEV DEV CI CI Docker Registry Integr. Integr. Dev

    orange lines are data flow and blue lines are control flow
  15. VCS DEV DEV CI CI Integr. Integr. Dev Docker Registry

    docker push orange lines are data flow and blue lines are control flow
  16. VCS DEV DEV CI CI Integr. Integr. Dev Docker Registry

    ssh + docker run orange lines are data flow and blue lines are control flow
  17. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry orange lines are data flow and blue lines are control flow
  18. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry install that thing orange lines are data flow and blue lines are control flow
  19. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry ssh + docker run orange lines are data flow and blue lines are control flow
  20. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod orange lines are data flow and blue lines are control flow
  21. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod Ops orange lines are data flow and blue lines are control flow
  22. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod Ops orange lines are data flow and blue lines are control flow
  23. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod Ops orange lines are data flow and blue lines are control flow
  24. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod Ops orange lines are data flow and blue lines are control flow
  25. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod orange lines are data flow and blue lines are control flow
  26. VCS DEV DEV CI CI Integr. Integr. Helper Dev Docker

    Registry Pre Prod Pre Prod Prod Prod orange lines are data flow and blue lines are control flow
  27. VCS DEV DEV CI CI Integr. Integr. Scheduler (Master) Dev

    Docker Registry Pre Prod Pre Prod Prod Prod A A A orange lines are data flow and blue lines are control flow agent
  28. VCS DEV DEV CI CI Integr. Integr. Scheduler (Master) Dev

    Docker Registry Pre Prod Pre Prod Prod Prod A A A orange lines are data flow and blue lines are control flow
  29. Cluster State Master Worker Host w/ Agent Worker Host w/

    Agent Worker Host w/ Agent Worker Host w/ Agent Worker Host w/ Agent
  30. Worker Host w/ Agent Worker Host w/ Agent Worker Host

    w/ Agent Worker Host w/ Agent Worker Host w/ Agent Cluster State Master
  31. Worker Host w/ Agent Worker Host w/ Agent Worker Host

    w/ Agent Worker Host w/ Agent Worker Host w/ Agent commands desired state vs. reports actual state Cluster State Master
  32. Worker Host w/ Agent Worker Host w/ Agent Worker Host

    w/ Agent Worker Host w/ Agent Worker Host w/ Agent commands desired state vs. reports actual state Cluster State Master
  33. Worker Host w/ Agent Worker Host w/ Agent Worker Host

    w/ Agent Worker Host w/ Agent Worker Host w/ Agent commands desired state vs. reports actual state Cluster State Master
  34. Worker Host w/ Agent Worker Host w/ Agent Worker Host

    w/ Agent Worker Host w/ Agent Worker Host w/ Agent commands desired state vs. reports actual state Cluster State Master
  35. Which container runs on which host? How does the traffic

    come there? How do the services talk with each other? Orchestration
  36. Which container runs on which host? How does the traffic

    come there? How do the services talk with each other? How to do updates w/o service interruption? Orchestration
  37. Which container runs on which host? How does the traffic

    come there? How do the services talk with each other? How to scale out? How to do updates w/o service interruption? Orchestration
  38. Which container runs on which host? How does the traffic

    come there? How do the services talk with each other? Where do the logs go? How to scale out? How to do updates w/o service interruption? Orchestration
  39. Which container runs on which host? How does the traffic

    come there? How do the services talk with each other? Where do the logs go? How to scale out? How to do updates w/o service interruption? Orchestration
  40. I. Codebase One codebase tracked in revision control, many deploys

    II. Dependencies Explicitly declare and isolate dependencies III. Config Store config in the environment IV. Backing Services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes
  41. VII. Port binding Export services via port binding VIII. Concurrency

    Scale out via the process model IX. Disposability Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity Keep development, staging, and production as similar as possible XI. Logs Treat logs as event streams XII. Admin processes Run admin/management tasks as one-off processes
  42. Databases • Very own requirements: • State-full • Low CPU

    but high I/O • Distributed data • (usually) complex to scale • (usually) not built for “hot swap” •  not 12 Factor applications
  43. Databases • Don’t dockerize databases • Keep them external to

    the system • DBA will love you not hate you • Easier to maintain • Very own cluster mechanisms • Easier routing in Datacenters