Use the builder stage pattern in Dockerfiles
Posted on January 15, 2023
| Diego J. Romero-López
Use the builder stage pattern in Dockerfiles Most of the time, some libraries that we install in a docker image are only used for the construction of our executables. Could we just not include in our final docker image?
Docker images should be minimal As we saw in our previous post, docker images should be minimal for several reasons, but the aim is to reduce the cost of the transference of the docker image.
[Read More]
Reduce the size of your builder images
Posted on January 14, 2023
| Diego J. Romero-López
Reduce the size of your builder images Docker images should have a small size. For example, Alpine Linux images have a mere 50MB of size, debian-slim is 50-60MB of size. Why do we seek a small size footprint? One reason is simply because the docker images are usually pushed to, and download from, docker repositories like dockerhub or other private docker repositories.
Use a small base image Alpine and debian-slim-stable are like 50MB.
[Read More]
Don't be Percival
Posted on December 19, 2022
| Diego J. Romero-López
Don’t be Percival Percival is a mythologic figure, a mighty knight associated with King Arthur, the knights of the round table, and the search for the grail. How is the myth related with starting working in a new team?
The myth In Chrétien De Troyes' poem The Story of the Grail, Percival, a young boy that dreams of becoming a knight lives in a farm with his mother. He descends from a long tradition of knights (his deceased father and grandfather were knights) but he does not know.
[Read More]
Fail fast and often
Posted on December 17, 2022
| Diego J. Romero-López
Fail fast and often Being fail-tolerant is valued in organizations as in a changing world where requirements, technologies or even team members can change from one day to the next, having adaptative capacities is gold.
Wait, what are you talking about? I am talking about having the ability to prioritize our work as developers. Everything has not the same importance and our resources are finite.
You have to know what is the aim of your organization.
[Read More]
Override docker-compose.yml files
Posted on December 5, 2022
| Diego J. Romero-López
Override docker-compose.yml files Sometimes we want to have different versions of docker-compose.yml files (one for production and one for development). Each environment has their own characteristics (slightly different images for example) we show here a good way to override sections of a docker-compose.yml file easily.
Why? Sometimes we have several environments that share almost all docker configuration. Having a common docker-compose.yml file and several docker-compose.override.yml files is a great way to manage your service configurations.
[Read More]
Actual integration tests
Posted on November 27, 2022
| Diego J. Romero-López
Many times we have some piece of code that is tested but is still failing in production. How is that possible? Is that because of bad tests or we have a greater hidden issue?
Protect your vital functionality with integration tests Integration tests are the best way make sure that a functionality does not degradate when adding new features.
What are integration tests Integration tests are tests that check a full feature of the project.
[Read More]
Add changes to your last commit
Posted on November 16, 2022
| Diego J. Romero-López
Have you ever created a commit with a meaningful message and, later wanted to add or modify something to it? And what about if you pushed that commit? Here we are going to see how you add changes to a commit, independently of if it was pushed or not.
How-to Let’s suppose we have just pushed a commit and we want to add another change to it. This process is called amend.
[Read More]
Rewrite git branch history
Posted on November 13, 2022
| Diego J. Romero-López
Rewrite your git branch history Ever had a pushed branch that is completed and ready for review but the git history is too long and full of commits wit.
How to The process is very clear. You only have to get the changes, move your point to the branch you want to merge (usually master), unstage everything, creating new committs, and force push the changes.
Let us see the process step by step:
[Read More]
EyesOnly
Posted on November 5, 2022
| Diego J. Romero-López
Secrets are usually involuntary leaked by developers. Sometimes they are sent to external services like or written in a log by accident. Would not be useful to have a tool to limit the access to secrets? Enter EyesOnly.
EyesOnly: a package to limit access to secrets Dealing last years with containerazing applications has left me thinking in how we are passing some secrets as environment variables to the container. This is standard practice by the Cloud Native practitioners.
[Read More]
Allow writing of files in docker in Linux
Posted on October 17, 2022
| Diego J. Romero-López
Docker is a container system that allow developers to have a common environment to develop and SRE/devops to have machine-independent deployment process.
Allow writing of files in docker in Linux I have been working on a small project in Python: functainer. The goal of this project is to provide a Python package to run functions in docker seamlessly: you only will docker and Python to run it.
Anyway, that project uses files as a mean of communication, i.
[Read More]