Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

Patterns and antipatterns in Docker image lifecycle as was presented at DC Docker Meetup August 2017

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio

Eche un vistazo a continuación

1 de 68 Anuncio

Patterns and antipatterns in Docker image lifecycle as was presented at DC Docker Meetup August 2017

Descargar para leer sin conexión

While Docker has enabled an unprecedented velocity of software production, it is all too easy to spin out of control. A promotion-based model is required to control and track the flow of Docker images as much as it is required for a traditional software development lifecycle. New tools often introduce new paradigms. We will examine the patterns and the antipatterns for Docker image management, and what impact the new tools have on the battle-proven paradigms of the software development lifecycle.

While Docker has enabled an unprecedented velocity of software production, it is all too easy to spin out of control. A promotion-based model is required to control and track the flow of Docker images as much as it is required for a traditional software development lifecycle. New tools often introduce new paradigms. We will examine the patterns and the antipatterns for Docker image management, and what impact the new tools have on the battle-proven paradigms of the software development lifecycle.

Anuncio
Anuncio

Más Contenido Relacionado

Presentaciones para usted (20)

Similares a Patterns and antipatterns in Docker image lifecycle as was presented at DC Docker Meetup August 2017 (20)

Anuncio

Más de Baruch Sadogursky (20)

Más reciente (20)

Anuncio

Patterns and antipatterns in Docker image lifecycle as was presented at DC Docker Meetup August 2017

  1. 1. whoami Baruch Sadogursky, JFrog Developer Advocate, @jbaruch
  2. 2. Show notes! • http://jfrog.com/shownotes – Video (soon!) – Slides – Links – Feedback – Raffle! (come early)
  3. 3. JFrog Xray
  4. 4. Poll Time!
  5. 5. Poll Time! üHeard about Docker üCan do the tutorial üPoCing, playing etc. üProduction, baby! @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  6. 6. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  7. 7. JFrog Artifactory + Docker @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  8. 8. Who’s using Docker and nothing else?
  9. 9. The Promotion Pyramid Development builds Dev Integration tests Integr. tests Staging Pre-Prod Prod Amount of builds Build/Deploy time Amount of binaries
  10. 10. Pipeline: Quality Gates and Visibility Source: Agile ALM, Michael Hüttermann, Manning Publications Co. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  11. 11. $docker build @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  12. 12. Let’s docker build in every env! @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  13. 13. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu RUN apt-get install -y software-properties-common python RUN apt-get install -y nodejs RUN mkdir /var/www ADD app.js /var/www/app.js CMD ["/usr/bin/node", "/var/www/app.js"] Latest version Latest version Latest version Latest version
  14. 14. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu:14.04 RUN apt-get install -y software-properties-common python RUN apt-get install -y nodejs RUN mkdir /var/www ADD app.js /var/www/app.js CMD ["/usr/bin/node", "/var/www/app.js"] Better now?
  15. 15. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu:4033353383af19ec179c01dda7f355a246c6adcafaf93c8f98 RUN apt-get install -y software-properties-common python RUN apt-get install -y nodejs RUN mkdir /var/www ADD app.js /var/www/app.js CMD ["/usr/bin/node", "/var/www/app.js"] And now?
  16. 16. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu:4033353383af19ec179c01dda7f355a246c6adcafaf93c8f98 RUN apt-get install -y software-properties-common python RUN apt-get install -y nodejs RUN mkdir /var/www ADD app.js /var/www/app.js CMD ["/usr/bin/node", "/var/www/app.js"] And now?What about those?
  17. 17. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu:4033353383af19ec179c01dda7f355a246c6adcafaf93c8f98 RUN mvn clean install CMD ”java –jar Main.class" What about this?
  18. 18. That’s why. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES FROM ubuntu:4033353383af19ec179c01dda7f355a246c6adcafaf93c8f98 RUN download_random_sh*t_from_the_internet.sh CMD ["/usr/bin/node", "/var/www/app.js"] And how about this?
  19. 19. That’s why you don’t trust Docker @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  20. 20. Traditional Server Pattern http://martinfowler.com/bliki/ImmutableServer.html @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  21. 21. Immutable Server Pattern http://martinfowler.com/bliki/ImmutableServer.html @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  22. 22. What’s up with the gates?!
  23. 23. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  24. 24. What’s up with the gates?!
  25. 25. What’s up with the gates?! - QA shouldn’t test dev images
  26. 26. What’s up with the gates?! - QA shouldn’t test dev images - non-tested images shouldn't be staged
  27. 27. What’s up with the gates?! - QA shouldn’t test dev images - non-tested images shouldn't be staged - non-staged, non-tested or dev images shouldn’t end up in production!!!
  28. 28. Not so fast… @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  29. 29. Trumped-up limitations @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  30. 30. The Anatomy of Docker Tag @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  31. 31. Wait a second, how can I have more than one repository per host now?!
  32. 32. How can we support this? https://host:8081/artifactory/docker-dev/busybox https://host:8081/artifactory/docker-staging/busybox https://host:8081/artifactory/docker-qa/busybox https://host:8081/artifactory/docker-prod/busybox @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  33. 33. “ONE REGISTRY PER HOST OUGHT TO BE ENOUGH FOR ANYBODY.”
  34. 34. Panic! @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  35. 35. Virtual hosts/ports to the rescue Registry host Tag name docker tag host:port/busybox
  36. 36. Virtual hosts/ports to the rescue https://host:port/v2/busybox Registry host Tag name docker tag host:port/busybox
  37. 37. Virtual hosts/ports to the rescue https://host:8081/artifactory/docker-dev/busybox Virtual repository name Tag name https://host:port/v2/busybox Context name Registry host Tag name docker tag host:port/busybox
  38. 38. server { listen 5001; server_name 192.168.99.100; if ($http_x_forwarded_proto = '') { set $http_x_forwarded_proto $scheme; } rewrite ^/(v1|v2)/(.*) /artifactory/api/docker/docker-dev/$1/$2; … } } @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  39. 39. But then you realize… Wait a second, now I need to pull, retag and push for every step?!
  40. 40. Anatomy of a container @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  41. 41. Our Layers Application: ••.war file Framework: ••JDK8 + Wildfly Base: ••CentOS
  42. 42. Framework build - Verified base image - Add system dependencies from artifactory - JDK - wildfly - Own it!
  43. 43. Minimal Framework build Dockerfile FROM centos:7 MAINTAINER you@yourorg.com @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  44. 44. Application build - Framework is your base - Run a java build - Add a file to base - Done!
  45. 45. Application build Dockerfile FROM yourorg-docker.jfrog.io/yourorg/framework:latest MAINTAINER you@yourorg.com ADD https://yourorg.jfrog.io/yourorg/java-release-local/…/app-[RELEASE].war /opt/jboss/wildfly/standalone/deployments/app.war @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  46. 46. Application build Dockerfile FROM yourorg-docker.jfrog.io/yourorg/framework:latest MAINTAINER you@yourorg.com ADD https://yourorg.jfrog.io/yourorg/java-release-local/…/app-[RELEASE].war /opt/jboss/wildfly/standalone/deployments/app.war @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  47. 47. Application build Dockerfile FROM yourorg-docker.jfrog.io/yourorg/framework:latest MAINTAINER you@yourorg.com ADD https://yourorg.jfrog.io/yourorg/java-release-local/…/app-[RELEASE].war /opt/jboss/wildfly/standalone/deployments/app.war @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  48. 48. Application build Dockerfile FROM yourorg-docker.jfrog.io/yourorg/framework:latest MAINTAINER you@yourorg.com ADD https://yourorg.jfrog.io/yourorg/java-release-local/…/app-[RELEASE].war /opt/jboss/wildfly/standalone/deployments/app.war @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  49. 49. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  50. 50. Framework Pipeline Application Pipeline
  51. 51. Framework Pipeline Application Pipeline
  52. 52. Framework Pipeline Application Pipeline
  53. 53. @JBARUCH #DOCKERDC HTTP://JFROG.COM/SHOWNOTES
  54. 54. HIGH QUALITY (software and information) SPEED LOW COST (automation) Fast releases > Modular > Automation Conclusions: Release Fast or Die!
  55. 55. Q&A and Links • @jbaruch • #DockerDC • http://jfrog.com/shownotes – Video (soon!) – Slides – Links – Feedback – Raffle! (come early)

×