In this article, the author shares their experience of creating an official Dockerfile for their shell script, ugit, and optimizing the image size. The author mentions that they have experience with Dockerfiles but had never published one on the Docker Hub registry before. They explain that the ugit script is written in bash and they have no plans to rewrite it in another language. The author goes on to describe their step-by-step guided optimization attempts, using multi-stage builds, removing unnecessary binaries and dependencies, and utilizing scratch as the base image. They also highlight some surprising discoveries, such as xargs and awk being present by default in Alpine images. The author concludes by sharing the final Dockerfile and the reduced image size of 17.6 MB, a 40% reduction from their first attempt.
https://bhupesh.me/publishing-my-first-ever-dockerfile-optimization-ugit/