Container sizes for applications are often a concern. I recently came across distroless from Google that seems to solve this pain-point while also reducing the potential vulnerability surface of the container as well. So I was looking for a suitable target to try this on.
I use MailHog for testing emails in dev. The published container is unfortunately too old. So seemed like a good opportunity to try distroless. I really wanted to go with a the static base image, but unfortunately ran into issues with CGO_ENABLED=0 for build. For now, the base build will be fine. Here’s the Dockerfile for generating a distroless image of MailHog