glibc
Why the Minimus distro relies on glibc
Minimus, like most popular Linux distributions, uses GNU C Library glibc as its standard C library. This places Minimus alongside many mainstream distros, including Ubuntu, Debian, Fedora, RHEL, CentOS, and others.
The use of glibc is not entirely universal but it has its advantages, as explained below. In contrast, Google’s Distroless images and Alpine Linux use musl as the C library, instead of glibc.
Both glibc and musl are implementations of the standard C library, but glibc is substantially more predictable and easier to work with. While Musl is said to be more lightweight, its tradeoffs are heavy.
Here’s why Minimus favors glibc:
1. Security awareness
glibc has more sanity checks and is generally considered more secure and less prone to exploitation. For example, glibc has built-in stack smashing to protect against buffer overflows, whereas musl will allow vulnerable programs to run without warning.
2. DNS resolution
By design, musl doesn’t support DNS-over-TCP. This alone is responsible for many Alpine DNS issues including host resolution failures.
The DNS resolution failure is only manifest in Kubernetes, not Docker container. This means everything will work as expected when you test locally, so you’ll only discover the issue once you deploy the application to a cluster.
3. Compatibility
Compatibility issues are significantly reduced with glibc, compared with musl. For example, glibc supports Node.js by default, dynamic-linking, and multithreading. As a result, images using glibc are more portable and will work on a greater range of hardware and environments.
4. Performance
While musl does show a slight advantage in compilation time, glibc shows significantly shorter build times, especially with python.
5. Memory usage
Runtime performance for glibc is far superior to musl. The advantage is particularly prominent when large memory allocations are required.
glibc is the library of choice for memory-intensive applications and will greatly reduce the risk of performance issues.