Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Docker for the Brave

454 views

Published on

Introduction to Docker and Docker compose. Getting started with basic setup and understanding why it is needed....

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Docker for the Brave

  1. 1. DOCKER FOR THE BRAVE INTRODUCTION FOR BUSY PEOPLE
  2. 2. AGENDA AGENDA ▸ The need for containers ▸ Overview: Docker and the Docker Ecosystem ▸ Basic Docker Workflows
  3. 3. “Well, it worked on my machine!”
  4. 4. THE NEED FOR CONTAINERS TRADITIONAL SOFTWARE DELIVERY SUFFERS FROM GAP BETWEEN DEV AND PROD STABILITY AND ROBUSTNESSFLEXIBILITY Development Production
  5. 5. THE NEED FOR CONTAINERS TRADITIONAL SOFTWARE DELIVERY SUFFERS FROM GAP BETWEEN DEV AND PROD Loan Application JDK 8 WILDFLY MYSQL MAC OSX Production JDK 6 WEBLOGIC ORACLE AIX FIREWALL SECURITY INFRASTRUCTURE MONITORING … ?
  6. 6. Magic Operations Guide Template
  7. 7. Unicorns do not exist!
  8. 8. THE NEED FOR CONTAINERS CONTAINERIZED APPLICATIONS OFFER A WAY TO NARROW THE GAP ▸ Immutable containers reduce human errors ▸ Instead of “works on my machine” you deploy the machine ▸ Think diapers
  9. 9. THE NEED FOR CONTAINERS PACKAGE ONCE DEPLOY ANYWHERE CODE RUNTIME SYSTEM TOOLS LIBRARIES Container
  10. 10. THE NEED FOR CONTAINERS Loan Application JDK 7 MYSQL CORE OS WILDFLY Container Production Sales Application JDK 8 NEO4J ALPINE JETTY Container JDK 7 MYSQL CORE OS WILDFLY Container JDK 8 NEO4J ALPINE JETTY Container
  11. 11. THE NEED FOR CONTAINERS VIRTUALIZATION VS. CONTAINERS SPEED FOOTPRINT SIMPLICITY
  12. 12. DOCKER BOOTCAMP
  13. 13. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE DOCKER ECOSYSTEM CONSISTS OF FIVE ESSENTIAL PARTS Docker SwarmMachine Compose Network
  14. 14. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM WE’LL ONLY COVER THE BASICS Docker Machine Compose Swarm Network
  15. 15. LINUX VM (BOOT2DOCKER.ISO) OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM DOCKER-MACHINE HELPS GETTING STARTED ON NON LINUX BOXES DOCKER HOST WILDFLY MYSQL REDIS
  16. 16. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM DOCKER TOOLBOX TO THE RESCUE ▸ Offers a one stop Docker setup for non- Linux machines ▸ Easiest way to get started on Mac and Windows ▸ Includes everything covered in theses slides https://www.docker.com/docker-toolbox
  17. 17. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM DOCKER IN A NUTSHELL REGISTRYDOCKER HOST DOCKER CLIENT CONTAINER CONTAINER CONTAINER IMAGE IMAGE
  18. 18. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM IMAGES AND CONTAINERS IMAGE ALPINE:3.1 CONTAINER: DREAMY_HUGLE B00F46831AF3 CONTAINER: SLEEPY_GOLICK F0A1172ADB12 CONTAINER: JOLLY_BABBAGE D0BAE89AD214
  19. 19. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM CONTAINER LIFECYCLE CREATED STARTED STOPPED REMOVED
  20. 20. DEMO TIME BUILDING A LOCAL TWITTER ▸ Bootstrap demo ▸ Basic container usage
  21. 21. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM EXPOSING SERVICES
  22. 22. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM CONTAINER PORTS ARE NOT VISIBLE OUTSIDE OF THE DOCKER HOST
  23. 23. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM CONTAINER PORTS ARE NOT VISIBLE OUTSIDE OF THE DOCKER HOST ? DOCKER HOST CONTAINER: DREAMY_HUGLE B00F46831AF3 80 443
  24. 24. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM CONTAINER PORTS MUST BE MAPPED TO EXTERNALLY VISIBLE PORTS
  25. 25. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM CONTAINER PORTS MUST BE MAPPED TO EXTERNALLY VISIBLE PORTS DOCKER HOST CONTAINER: DREAMY_HUGLE B00F46831AF3 80 443 8080
  26. 26. DEMO TIME BUILDING A LOCAL TWITTER ▸ Bootstrap demo ▸ Basic container usage ▸ Running ngnix ▸ Exposing ports
  27. 27. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS VERSIONED CONTAINER: TEST F0A1172ADB12 CREATED STARTED
  28. 28. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS VERSIONED CONTAINER: TEST F0A1172ADB12 foo CREATED STARTED
  29. 29. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS VERSIONED CONTAINER: TEST F0A1172ADB12 foo STARTED STOPPED
  30. 30. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM SURVIVES RESTARTS CONTAINER: TEST F0A1172ADB12 foo STARTED STOPPED
  31. 31. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM SURVIVES RESTARTS CONTAINER: TEST F0A1172ADB12 foo STARTED
  32. 32. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS VERSIONED CONTAINER: TEST F0A1172ADB12 foo CREATED STARTED STOPPED REMOVED
  33. 33. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS TRANSIENT CONTAINER: TEST F0A1172ADB12 foo STOPPED REMOVED
  34. 34. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS TRANSIENT CONTAINER: TEST D8C89E9BB6AB CREATED STARTED
  35. 35. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS TRANSIENT CONTAINER: TEST D8C89E9BB6AB CREATED STARTED
  36. 36. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE CONTAINER FILESYSTEM IS SEPARATED FROM THE HOST ENVIRONMENT HOST CONTAINER: DREAMY_HUGLE B00F46831AF3
  37. 37. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM PERSISTENT VOLUMES ARE USED TO SHARE DATA BETWEEN HOST AND CONTAINER HOST CONTAINER: DREAMY_HUGLE B00F46831AF3 CONTAINER: SLEEPY_GOLICK F0A1172ADB12 VOLUME: DATA
  38. 38. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM PERSISTENT VOLUMES ARE USED TO SHARE DATA BETWEEN HOST AND CONTAINER HOST CONTAINER: MYWEB B00F46831AF3 VOLUME: ~/SHARED VOLUME: /USR/SHARE/NGINX/HTML/ foo.htmlfoo.html
  39. 39. DEMO TIME BUILDING A LOCAL TWITTER ▸ Bootstrap demo ▸ Basic container usage ▸ Running ngnix ▸ Exposing ports ▸ Sharing volumes and data ▸ Monitoring
  40. 40. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM THE DOCKERFILE IS THE RECIPE FOR AN IMAGE IMAGE KOENIGHOTZE/JDK8 Dockerfile
  41. 41. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM READ WRITE LAYER READ LAYER READ LAYER READ LAYER
  42. 42. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM
  43. 43. OVERVIEW: DOCKER AND THE DOCKER ECOSYSTEM IMAGES ARE LAYERED; EACH LAYER IS CACHED OR FETCHED INDIVIDUALLY KOENIGHOTZE/JDK8 FROM GLIDERLABS/ALPINE:3.3 … CMD ["BASH", "-L"] MAINTAINER DAVID SCHMITZ VOLUME [$SRC_VOLUME]
  44. 44. COMPLEX SCENARIOS USING COMPOSE
  45. 45. COMPOSITION COMPLEX SCENARIOS USING COMPOSE MANAGING DEPENDENCIES WITH DOCKER-COMPOSE CONTAINER: DREAMY_HUGLE B00F46831AF3 CONTAINER: SLEEPY_GOLICK F0A1172ADB12 CONTAINER: JOLLY_BABBAGE D0BAE89AD214
  46. 46. COMPLEX SCENARIOS USING COMPOSE USING DOCKER-COMPOSE FOR DEPENDENCIES* BOOKING ping mongodb MONGODB GUEST curl $GUEST_URI *Note: Compose V1 Syntax
  47. 47. MOVIE CONTAINER COMPLEX SCENARIOS USING COMPOSE DOCKER SINGLE HOST NETWORKING USING LINKS MOVIE.WAR ACTOR CONTAINER ACTOR.WAR
  48. 48. DEMO TIME CREATING A SIMPLE COMPOSITION WITH SPRING-BOOT AND DOCKER ▸ Create simple web application ▸ Add database as container ▸ Create compositions file ▸ Add volumes
  49. 49. BEYOND DOCKER WHAT IS NEXT? ▸ CoreOs and rkt ▸ Docker Swarm and Kubernetes ▸ Unikernels (!)
  50. 50. BEYOND DOCKER AND SUMMARY SUMMARY ▸ Docker is production ready ▸ Docker-Compose is targeted towards developers and should not be used for production ▸ Might have some issues with regards to networking and clustering ▸ Multi-Cloud deployments possible ▸ Community is vital and eager to help
  51. 51. WANT TO KNOW MORE? TRY ONE OF THESE GREAT VAULTS OF WISDOM ▸ Docker Home Page: https://www.docker.com/ ▸ Docker Cheat Sheet: https://github.com/wsargent/docker-cheat-sheet ▸ James Turnbull, Dockerbook: http//www.dockerbook.com/
  52. 52. THANK YOU! <david.schmitz@senacor.com>
  53. 53. BACKUP <>
  54. 54. THE NEED FOR CONTAINERS Loan Application JDK 7 MYSQL CORE OS WILDFLY Container JDK 8 NEO4J ALPINE JETTY Container RUBY POSTGRES ALPINE RAILS Container … … … … Container

×