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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.