We've all been there: you whip up a simple microservice in Python, write a quick Dockerfile, run docker build, and suddenly your container image weighs almost half a gigabyte (or 1.75 GB uncompressed on disk!).
For a 15-line Flask application with two routes? That felt unacceptable.
Bloated Docker images slow down CI/CD pipelines, increase registry storage bills, consume unnecessary bandwidth during deployment, and—worst of all—expand the security attack surface with packages that have no business being in a production container.
In this project, I took a bloated baseline image and systematically redesigned it. The outcome?
Here is the full breakdown of how I did it, the pitfalls I ran into, and the key lessons you can apply to your own containers today.






