Why I Will Never Use Alpine Linux Ever Again

<p>Nowadays, Alpine Linux is one of the most popular options for container base images. Many people (maybe including you) use it for anything and everything. Some people use it because of its small size, some because of habit, and some, just because they copy-pasted a&nbsp;<code>Dockefile</code>&nbsp;from some tutorial. Yet, there are plenty of reasons why you should not use Alpine for your container images, some of which can cause you grief.</p> <h1>The Source of All The Grief</h1> <p>To understand what makes Alpine a bad choice in some situations, we first need to talk about&nbsp;<code>musl</code>.&nbsp;<code>musl</code>&nbsp;is an implementation of C standard library. It is more lightweight, faster, and simpler than&nbsp;<code>glibc</code>&nbsp;used by other Linux distros, such as Ubuntu. Both of these implementations are interchangeable for the most part, that&#39;s why in most cases, you can switch from, e.g., Ubuntu to Alpine and never notice any difference.</p> <p>However, the little differences can cause all the grief. Some of it stems from how&nbsp;<code>musl</code>&nbsp;(and therefore also Alpine) handles DNS (it&#39;s always DNS), more specifically,&nbsp;<code>musl</code>&nbsp;(by design) doesn&#39;t support&nbsp;DNS-over-TCP. Usually, you would not notice this difference because most of the time, a single UDP packet (512 bytes) is enough to resolve hostnames... until it isn&#39;t enough, and your application (running on Kubernetes) that previously worked completely fine for months suddenly starts throwing &quot;Unknown Host&quot; exceptions for one particular (very critical) hostname. The worst part is that this can manifest randomly, anytime when some external network change causes the resolution of some particular domain to require more than the 512 bytes available in a single UDP packet.</p> <p><a href="https://betterprogramming.pub/why-i-will-never-use-alpine-linux-ever-again-a324fd0cbfd6">Visit Now</a></p>