Write secure and efficient Dockerfiles

This post covers some best practices for building secure and efficient docker images. This is not an exhaustive list, but covers most best practices for writing good enough secure & efficient Dockerfiles.

Project structures

Structuring a project is not really exciting, nor is it the main focus in a project life, but it’s certainly one of the most important decision to make at the beginning of the project if you do not want to have a massive refactoring afterwards and if you want your project to be quickly understood and workable by other developers.

If you want to directly check the code: Github project

Debug Java container

Debugging a Java container is the same as debugging a remote Java application. All you need to do is to add some arguments to the JVM, run the Java application and attach the debugger.

Playing with Kafka

During the COVID-19 shutdown, one way to “pass time” is to learn and play with new things.

I made a small project, heart-rate-calculator, whose goal is to take a file containing heartbeat information in input, compute and write the heart rates in another file.

That was quite a nice project, but I was wondering if I want to go further, what the project would look like? Let’s say, I want to have a whole SAAS solution, production-ready, to read a stream of data from smart-watches that measure heartbeats, then compute their heart rates and display a graph to the user. Of course, if that’s just that, it will be too simple, so what about having the challenge of dealing with massive amount of data. Mmh, a bit more tricky.

This is a good opportunity to play with Kafka and Kafka Streams! In this blog post, I will show how to build a resilient system to compute and generate heart rates from heartbeat data.

If you are in hurry, you can check the source code here: https://github.com/l-lin/poc-kafka