How I reduced the size of my very first published docker image by 40% - A lesson in dockerizing shell scripts

153 · Bhupesh Varshney · Feb. 3, 2024, 9:39 a.m.
Summary
I interact with Dockerfiles every day at work, have written a few myself, built containers, and all that. But never published one on the docker hub registry. I wanted to make ugit - a tool to undo git commands (written as a shell script) available to folks who don’t like installing random shell scripts from the internet. Yeah, I know, I know. REWRITE IT IN GO/RUST/MAGICLANG. The script is now more than 500+ lines of bash. I am not rewriting it in any other language unless someone holds a gun to ...