by TechBro8615 · 3y ago · 0 comments
It's cool that we have an alternative to glibc, and it's cool that the popularity of Alpine Docker base images has caused developers to put the effort into expanding compilation support to a wide range of binaries. But personally, I got sick of how many hours I spent debugging a seemingly endless train of binaries that would fail in strange ways when running under Alpine, or that just didn't run at all because they were compiled with glibc. So I gave up and switched to using Ubuntu as a base image and never looked back.
I've never even understood the obsession with minimizing base image size, because it's not like it gets loaded into memory, and the fact that it's a base image means you share it with multiple images anyway, so you rarely even need to download or upload the layer over the network.
In theory image size shouldn't matter because of Docker's caching. In practice, however, many of the things we use around Docker (CI/CD, testing, orchestration and deployment tools...) don't take advantage of that cache.
A GitLab CI stage to build my container will still pull the base image and build up from layer 1 every time. The subsequent testing stages will do the same with the final image. The deployment stage will also need to pull it first, just to push it to the registry again, but with a tag this time.
The difference between the base image being a few dozen vs a few hundred megabytes translates directly into not just how much strain I'm putting on the network, but how long the pipeline takes. If I can reduce that by essentially just swapping the base image and search-replacing apt-get with apk, why not? Of course it isn't always that simple, but for most things where you're just something like Node or Python with minimal native extensions, it's definitely worth it.
Isn’t it also the case that less “bloat” can mean less code that potentially leads to fewer bugs? Reducing bloat can have other benefits sometimes.
https://wiki.alpinelinux.org/wiki/Installation#Diskless_Mode