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.

Using Docker to Build Software

72 views

Published on

Over the past year or so I’ve been focusing a good amount on trying to help clients move toward a Continuous Delivery/Continuous Deployment mindset. To that end, I’ve spent a lot of time building pipelines in various CI tools. Something that’s become a common tool in my kit is using Docker containers to build the various projects in our pipelines. This has a lot of very interesting benefits, but also comes with a few challenges.

In my talk I’ll tell you why you should care about building your software with Docker. I will also outline the plusses and minuses of this approach, and relay as many of the various tips and tricks I’ve found in my use of it over the past year or so. After my talk is over you should have a clear understanding of this approach, and whether or not you should trial it.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Using Docker to Build Software

  1. 1. Using Docker to Build Software James Thomas
  2. 2. DISCLAIMER: THIS ISN’T ABOUT DOCKERIZING YOUR APPLICATION 2
  3. 3. DISCLAIMER: HAVE STRONG INFRASTRUCTURE AS CODE PRACTICES? YOU MAY BE GOOD 3
  4. 4. “SO, WHAT IS THIS?” AND “WHY DO THIS? 4
  5. 5. BUILD AGENTS OFTEN MANAGED BY A SEPARATE TEAMS 5
  6. 6. SHARED AGENT POOL = COLLECTION OF SNOWFLAKES 6
  7. 7. CAN REPRODUCE BUILD ENVIRONMENT LOCALLY* 7
  8. 8. “WHAT’S THE CATCH?” 8
  9. 9. DIFFERENCES BETWEEN HOST OSES SOMETIMES MATTER 9
  10. 10. DIFFERENCES BETWEEN HOST OSES SOMETIMES MATTER 10
  11. 11. PERFORMANCE PENALTY; FILE MOUNTS ON NON- LINUX OSES 11
  12. 12. ONE MORE THING THAT CAN GO WRONG 12
  13. 13. THE --RM FLAG e.g. docker run --rm gradle:jdk8 gradle test build 13
  14. 14. MOUNT CURRENT WORKING DIRECTORY INTO YOUR BUILD CONTAINER e.g. docker run –v `pwd`:/root/src gradle:jdk8 gradle test build 14
  15. 15. PASS CURRENT USER INTO CONTAINER TO PREVENT FILE PERMISSION ISSUES e.g. docker run –v `pwd`:/root/src –u `id –u`:`id –g` gradle:jdk8 gradle build 15
  16. 16. PASS CURRENT USER INTO CONTAINER TO PREVENT FILE PERMISSION ISSUES e.g. docker run –v `pwd`:/root/src –u `id –u`:`id –g` gradle:jdk8 gradle build 16
  17. 17. USING DOCKER-COMPOSE e.g. docker-compose run buildRunner gradle test build 17
  18. 18. TESTING YOUR CONTAINER https://github.com/zuazo/dockerspec 18
  19. 19. THIS IS PRETTY NEAT, MAYBE TRY IT OUT? 19
  20. 20. THANK YOU Questions, comments, or feedback? jmthomas@thoughtworks.com

×