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 business: How I stopped worrying about antipatterns

360 views

Published on

Lenses.io presentation @Docker Meetup Athens on Docker for Business. Presented by Marios Andreopoulos.

Published in: Software
  • Be the first to comment

  • Be the first to like this

Docker for business: How I stopped worrying about antipatterns

  1. 1. https://lenses.io London, Athens, New York Docker for business and how I stopped worrying about antipatterns Marios Andreopoulos
  2. 2. DataOps for Streaming Data https://lenses.io
  3. 3. ● Background in ECE, System Administration, DevOps/SRE ● GNU, Linux, Go, Emacs, Free Software, Open Source, Hacking Lover ● Part of Lenses.io founding team ● Currently working on: ○ DevOps ○ SRE ○ Support ○ Sales Engineering and Customer Relations Head of Dev & IT Operations w. bow, horn and mouse ears (2019)
  4. 4. Lenses.io We are doing good! ● About 55 people, around half based in Greece ● Many clients ● Significant and increasing revenue
  5. 5. Success is a chain of events Docker is a link on our chain
  6. 6. Docker is a tool. Like a screwdriver or a… laptop.
  7. 7. Sharing our OSS Tools We use it for...
  8. 8. Creating reproducible builds We use it for...
  9. 9. Sharing environments We use it for...
  10. 10. Deploying our internal tools We use it for...
  11. 11. Deploying 3rd party internal tools We use it for...
  12. 12. Packaging our software We use it for...
  13. 13. Testing our software We use it for...
  14. 14. Advertising & Demoing Lenses We use it for...
  15. 15. Marketing We use it for...
  16. 16. And even meetups... We use it for...
  17. 17. What creates business value?
  18. 18. What creates value for customers? For engineers? For investors? For bloggers? For students? ...
  19. 19. In this context, do antipatterns matter?
  20. 20. They say, that… If all you have is a hammer, everything looks like a nail.
  21. 21. Maybe strict best practices and patterns, make our tools look more like hammers?
  22. 22. Break the rules if you can give me a good excuse
  23. 23. Docker is simple to use, so everyone should write docker files Always enforce practice? Some questions: ● Are you using the image in production? ● How many people will use the image? ● Is someone on your team who can debug?
  24. 24. A container should only do one thing Always enforce pattern? https://github.com/lensesio/fast-data-dev/tree/master/filesy stem/usr/local/share/landoop/etc/supervisord.templates.d
  25. 25. Use exec for the main container process Good practice https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L813
  26. 26. A container should not run as root Enforce pattern? https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L708 https://github.com/lensesio/fast-data-dev/blob/master/filesy stem/usr/local/share/landoop/etc/supervisord.templates.d/0 2-broker.conf
  27. 27. Enforce quality When you can https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L15
  28. 28. Provide debug capabilities Good pattern https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L10 https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L775 https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L779
  29. 29. Is the port available? Pitfall https://gitlab.com/andmarios/checkport/blob/master/main.g o https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L470
  30. 30. Can we write to the file? The volume? Pitfall https://github.com/lensesio/lenses-docker/blob/master/Doc kerfile#L61 https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L164
  31. 31. Argue both ways Good pattern? https://github.com/lensesio/kafka-topics-ui/pull/135
  32. 32. Many dockers? Keep things consistent Good practice https://github.com/lensesio/kafka-topics-ui https://github.com/lensesio/schema-registry-ui https://github.com/lensesio/kafka-connect-ui
  33. 33. Explicitly add files (whitelist) Good practice
  34. 34. Many external files? Keep them under a directory, use structure. Good practice https://github.com/lensesio/fast-data-dev
  35. 35. Keep your user contracts Good practice
  36. 36. Use multistage builds Good practice https://hub.docker.com/repository/registry-1.docker.io/land oop/fast-data-dev/builds/c2e00a24-5c8a-4649-8758-a3574 327195c https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L1 https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L321
  37. 37. Are slim images always best? Good practice? https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L321 https://github.com/lensesio/lenses-docker/blob/master/Doc kerfile#L1
  38. 38. Always store build information Good practice https://github.com/lensesio/lenses-docker/blob/master/Doc kerfile#L50 https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L273 https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L428
  39. 39. Build on the hub. Use hooks to gather build info and create tags Useful practice https://github.com/lensesio/lenses-docker/blob/master/hoo ks/build https://github.com/lensesio/lenses-docker/blob/master/hoo ks/post_push
  40. 40. Learn bash Seriously
  41. 41. Allow for build args Good practice https://github.com/lensesio/fast-data-dev/blob/master/Dock erfile#L18
  42. 42. To expose supervisor or not? Pattern or antipattern? https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L266
  43. 43. People love good entertainment Creativity is a pattern
  44. 44. Follow conventions Good pattern https://github.com/lensesio/fast-data-dev/blob/master/filesy stem/usr/local/share/landoop/config_kafka.sh
  45. 45. No uninitialized vars Good practice https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L19
  46. 46. Mind the JVM Good practice https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L140 https://github.com/lensesio/fast-data-dev/blob/master/setup -and-run.sh#L482
  47. 47. Respect the logs Good practice https://github.com/lensesio/kafka-connect-ui/blob/master/d ocker/run.sh#L89
  48. 48. Secrets may come in base64 Pitfall https://github.com/lensesio/lenses-docker/blob/master/setu p.sh#L247
  49. 49. Print a delayed message in the console Ok, that’s a hack https://github.com/lensesio/fast-data-dev/blob/lenses/filesy stem/usr/local/share/landoop/etc/supervisord.templates.d/0 0-delayed-message.conf
  50. 50. For developers expose everything, like logs Good practice https://github.com/lensesio/fast-data-dev/blob/lenses/filesy stem/usr/local/share/landoop/etc/Caddyfile#L37
  51. 51. Provide examples Good practice https://github.com/lensesio/lenses-docker
  52. 52. Thank you! https://lenses.io London, Athens, New York
  53. 53. https://lenses.io London, Athens, New York Find us: ● https://lenses.io ● https://github.com/lensesio ● https://hub.docker.com/u/landoop ● https://hub.docker.com/u/lensesio ● https://www.linkedin.com/company/lensesio/ ● https://twitter.com/lensesio ● https://launchpass.com/lensesio We are hiring: ● https://lenses.io/careers/ ● I am building a new team with junior and mid-level support people with a track to DevOps/SRE.

×