The document discusses Docker and how the company Lenses.io uses it for various purposes like reproducible builds, sharing environments, deploying tools, packaging software, and testing. It addresses whether strict adherence to best practices and patterns is always necessary with Docker or if exceptions can be made in some cases. Several examples are provided of instances where Lenses.io either follows or breaks certain patterns with justification. The document advocates balancing practices with pragmatism and argues that what creates value for customers should take priority over rigid rules.
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. Lenses.io
We are doing good!
● About 55 people, around half
based in Greece
● Many clients
● Significant and increasing
revenue
5. Success is a chain of events
Docker is a link on our chain
6. Docker is a tool.
Like a screwdriver or
a… laptop.
30. 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?
31. 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
32. Use exec for the main
container process
Good practice
https://github.com/lensesio/lenses-docker/blob/master/setu
p.sh#L813
33. 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
34. Enforce quality
When you can
https://github.com/lensesio/lenses-docker/blob/master/setu
p.sh#L15
36. 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
37. 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
38. Argue both ways
Good pattern?
https://github.com/lensesio/kafka-topics-ui/pull/135
39. 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
43. 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
44. 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
45. 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
46. 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
52. No uninitialized vars
Good practice
https://github.com/lensesio/fast-data-dev/blob/master/setup
-and-run.sh#L19
53. 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
54. Respect the logs
Good practice
https://github.com/lensesio/kafka-connect-ui/blob/master/d
ocker/run.sh#L89
55. Secrets may come in
base64
Pitfall
https://github.com/lensesio/lenses-docker/blob/master/setu
p.sh#L247
56. 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
57. 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
60. 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.