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

Martin Ahrer on Continuous Delivery Infrastructure With Docker

Martin Ahrer on Continuous Delivery Infrastructure With Docker

Transcript

  1. Continuous Delivery Infrastructure 1 . 1 with Docker

  2. About me Co-founder Enterprise Java User Group Austria Partner @

    Java Developer with strong focus on continuous delivery and Docker. Member of #dockermentor Software Craftsmen Gmbh & Co KG 1 . 2 Martin Ahrer
  3. The goal for this presentation Create a build infrastructure geared

    for a continuous delivery pipeline and have a walkthrough of the most important techniques used. Setup a build pipeline to build a Spring Boot application, Docker images and run integration tests. Eat your own dog food: this AsciiDoc slides are served from a Docker container running node.js + reveal.js. 1 . 3 just for the buzzwords …
  4. Containers 2 . 1 why should I care?

  5. Continuous Delivery 2 . 2

  6. Continuous Delivery 2 . 3 testing, staging, production environments

  7. Continuous Delivery 2 . 4 act fast …

  8. Some Docker myths 3 . 1 or I can’t use

    Docker because … and other excuses
  9. Docker replaces virtualization Containers are no virtualization technology, they do

    not use a hypervisor. Container != Virtual Server Containers and hypervisor virtualization can co-exist 3 . 2
  10. Docker is a platform lock-in Runs on any Linux distribution

    Is supported by Windows Server 2016+ (Windows Containers) Has been integrated into major cloud providers 3 . 3
  11. Containers add resource management overhead A docker container is represented

    by a single process Containers are managed by namespaces and cgroups → Containers run as secure, isolated processes A single Docker host can run hundreds of containers, resources are managed more efficiently 3 . 4
  12. Container versus Hypervisor 3 . 5

  13. Containers are much faster than virtual machines Modern hypervisors add

    little execution overhead Containers just provide better resource utilization Containers start up much faster than virtual servers Container provisioning is much faster than virtual server provisioning → Containers scale better with increasing number of builds/hr 3 . 6
  14. Summary Docker replaces virtualization Docker is a platform lock-in Containers

    are much faster than virtual machines Containers add resource management overhead In the context of continuous delivery, container provisioning and startup time is mostly relevant. € 3 . 7
  15. Demo 4 gradle build within a container

  16. Continuous Delivery Infrastructure 5 . 1 Simplified

  17. Add Jenkins Docker Container Who is compiling/building on master? 5

    . 2 Master and Build Agent
  18. Add Nexus3 Docker Container 5 . 3 Docker Registry

  19. Jenkins Build Pipeline The Jenkins master container has been omitted

    in the above diagram as it is only responsible for scheduling the pipeline instance on a matching agent. 5 . 4
  20. Docker techniques used 6 . 1

  21. Docker In Docker ( DinD ) Docker image for the

    agent provides Docker CLI from base image docker-compose CLI Jenkins Swarm Agent CLI for library/docker agent auto- discovery 6 . 2
  22. Docker Volumes Persist infrastructure data to survive container updates Provide

    /var/run/docker.sock to the agent container Provide build workspace filesystem to the agent container Provide gradle build cache volume reusable across builds 6 . 3 for data management
  23. Docker Software Defined Networks bridge network separated networks for infrastructure

    and app port mapping bind exposed container ports to host 6 . 4 a.k.a Docker networks
  24. docker-compose Eliminate shell scripting Makes managing multi-container applications simple Isolate

    environments running on a single host Makes data volumes survive container updates 6 . 5 is optional, just for convenience
  25. Let’s build something 7 Demo

  26. Thank you for attending 8 . 1

  27. Resources, Help, Consulting martin.ahrer@software-craftsmen.at softwarecraftsmen/continuousdelivery docker-jenkins-swarm-agent https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin http://blog.software-craftsmen.at/blog/2017/cd-infrastructure-as-code.html 8 .

    2
  28. Questions? 9