Selecting a suitable base container for your application

In the previous example, I chose to use Alpine as the base container for the application. So, why pick alpine over something more widely known, such as Ubuntu? The answer is size!

The Alpine Linux [1] container is one of the smallest base containers you can find out there. It ships with a small footprint libc implementation (musl) and uses busybox as its shell. As a result, the total size of the alpine container is only 5 M, thus making it ideal for hosting our Go static binaries. Furthermore, it includes its own package manager (apk), which lets you install additional packages such as the ca-certificates or network tools while the final container is being built.

What if we don't need ...

Get Hands-On Software Engineering with Golang now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.