I have lost count of how many times I have opened a container vulnerability report and saw that a large portion of the findings had little to do with the application. They were taken from the base image.
If you work with containers, you know the drill. You update your application dependencies, fix the findings you can control, rebuild the image, and scan again. But you are still stuck with operating system packages that your application may not even need.
I started wondering somewhere along the way about how we even build container images in the first place.
Here is a standard Dockerfile instruction:
FROM ubuntu:24.04
Enter fullscreen mode
Exit fullscreen mode
There is nothing wrong with that line. Ubuntu is a reasonable choice for many workloads. But how often do we look at all that it brings to our application? We are careful about the libraries we use in our code but not about base images.…