I Will Never Use Alpine Linux Ever Again
martinheinz.dev
martinheinz.dev
I've written a fair amount of C over my career. And let me tell you, shipping statically compiled binaries that cal getaddrinfo with musl "Just works". That is not the case with glibc which expects to be dynamically linked.
That and reasoning about the libc source is easier to do with musl as well.
Both drepper and felker are highly skilled individuals, but felker makes solid calls based on kiss. I love it and think he does great work.
I’m however not sure if this is correct
> Another example is Golang whose standard library - or more specifically net/http or os/user modules - depend on C libraries and therefore on glibc.
To my knowledge, no go standard library depends on cgo? Can you show me in the docs/source code where is stdlib using cgo? I am very surprised by this claim
edit: I might be wrong about musl declining patches. I swear I saw it happen but now I cannot find it
[0]:https://git.musl-libc.org/cgit/musl/commit/?id=51d4669fb9778...
Is there an RFC that deprecated DNS over UDP?
I think it’s a pretty unreasonable design decision.
Nowadays, both on my previous and current job, we go for Debian slim. Works perfectly and is worth the extra bytes.
I will also never use alpine again :-)
* K8 sets container to use `ndot:5`, causing the search list to be used * Musl walks that search list looking for domain * Cloudflare does not set the NXDOMAIN flag on a DNSSEC domain but does include an NSEC record (if you query with the dnssec flag). * Musl takes this 'NOERROR' reply and returns an EAI_NODATA.
Is Cloudflare wrong? I don't know, maybe. They say some things about the standards[0] and that it's technically 'right'. I don't see why they couldn't change the behaviour for queries without the dnssec flag, but I digress.
The issue is that every other libc I tested will continue searching and actually resolve the domain. Musl is the odd one out, and _only_ in the case where the search list ends up with domain using Cloudflare and dnssec.
Even if Musl is 'right' here, when it disagrees with major implementations and a major DNS nameserver does it really matter?
This was in golang code, so I ended up switching to `netdns=go` because like all the other libc's, the golang resolving code worked fine.
Maybe this situation improved a bit now.
Even those java/jdk-*-alpine images, claiming being able to run JDK actually support only subset of a (gigantic) APIs available in Java.
First, common C standard library implementations also include POSIX implementations, unnecessarily conflating the two. POSIX does not require `getaddrinfo` to implement DNS over TCP, indeed it doesn't even have to use DNS at all.
Second, many programs rely on the OS-provided DNS when using a more capable library would be a better choice. Then they don't read the documentation for `getaddrinfo`, fail to check the `hints` field returned to see that it's UDP only, and still try to fall back to TCP and return an inevitably confusing error.
POSIX `getaddrinfo` is usually not what you want, but unfortunately it often works well enough that you don't notice until someone tries to run your program on a different OS.
Come on over to the BSDs, both Open/NetBSD are very small and tight.
For example, ls(1) size:
NetBSD: 35616
Linux: 138816
Oooh-kaaaay.... sure, I guess
I find this surprising. Most DNS hostname lookups do work via UDP but I would expect TCP to also be supported. Caveat emptor.
I think its fair to say that most Linux developers test on glibc. Now I hear of some programs using ulibc or so forth (ex: Busybox) where space / embedded is key... but that's a purposeful choice with tradeoffs.
But for a general application... is there really any reason to port off of glibc?
> Section 6.1.3.2 of [RFC1123] is updated: All general-purpose DNS implementations MUST support both UDP and TCP transport.
For stub resolvers like the ones provided by glibc and musl:
> Stub resolver implementations (e.g., an operating system's DNS resolution library) MUST support TCP since to do otherwise would limit the interoperability between their own clients and upstream servers.
[1]: https://datatracker.ietf.org/doc/html/rfc7766#section-5
Wouldn't a similar approach work for most people? I don't know how it works in other companies, so perhaps I'm just privileged to not need a specific base image for everything.
No, the moment something doesn't quite meet your needs you must abandon it immediately.
Like for example I used to cycle a lot but then one day it snowed and my feet got cold and my bike got stuck in the snow, so now I will never cycle again and I just drive everywhere in a massive 6x6 7-tonne army truck, except I don't because that would be fucking idiotic.
I don't get why everyone has to be so polarised these days.
I’d personally like to see a fix, but my thinking might be different if I’d gone through what sounds like several days of downtime that could have been avoided.
I’d say this is a pretty reasonable gripe.