Hacker News new | ask | show | jobs
by traceroute66 1564 days ago
The moment I saw Alpine Linux in the title, my first guess was "I bet this is something to do with musl libc". Briefly looking through the blog, it looks like my gut feeling was correct.

A while ago I evaluated Alpine Linux. I wanted to like it, I really did, it ticked so many boxes.

But time and time again, I kept on running into issues with their adoption of musl libc.

The last straw for me was when I discovered packages in their package repo (some of which were well-known names) that were compiled against musl when the upstream developers quite clearly wrote in their docs that "if you compile X against anything other than glibc, you're on your own". For me, the fact that Alpine ignored this and compiled against musl anyway, was a big red flag. (And yes I raised some of these as bug reports, but the cases got closed and nothing done about it).

3 comments

>The last straw for me was when I discovered packages in their package repo (some of which were well-known names) that were compiled against musl when the upstream developers quite clearly wrote in their docs that "if you compile X against anything other than libc, you're on your own".

(I assume you meant "glibc", not "libc".)

That's how every software works. The software developer cares about A, B, C distros at most, so other distros are on their own. The maintainer of distro D takes responsibility themselves to make the package work on D. The maintainer needs to understand the software well enough to be able to assert that it will work on their distro, patch it as necessary to make that happen, and maintain those patches in the light of bug reports from the distro users.

>(And yes I raised some of these as bug reports, but the cases got closed and nothing done about it).

Well, yeah. Unless you find something that is irrecoverably broken against musl such that it can only be fixed by compiling against glibc, your bug report is pointless.

> (I assume you meant "glibc", not "libc".)

Yes, corrected.

> The maintainer of distro D takes responsibility themselves to make the package work on D.

Yeah, but Alpine are not doing that, or at least not at the time I evaluated. I got tired of finding distro supplied packages that just didn't work as expected because things broke unexpectedly because of musl.

I think its important to recognise that these are community projects -- they don't owe you anything so don't misunderstand this "responsibility" you're citing.

If something is an issue that's important to you, these things get solved when people like yourself make it known constructively with test cases or bug reports.

"you're on your own" is like, the expected thing when you are doing something different.

Still, Alpine is on top of everyone else when it comes to Docker Images sizes. Thats why it will stick.

If you care about image size you need to switch to a distroless image base. It's incredibly easy nowadays with multi-stage builds. IMHO people use alpine not because they seek it out but because they're reading old guides and advice that hasn't been updated with the times.

Blindly switching to alpine to save space is opening yourself up to exactly these sorts of musl-libc quirks and issues--you better have solid test coverage and a plan to make sure there aren't unexpected edge cases.

I would suggest to just use a small number of base images. The total size of all layerse is irrelevant in most cases if it's a small layer on top of something common for you = cached.
There are a lot of tools that simply can't run distroless and adding in all the requirements is often tedious with little reward.
What are some of the tools that can't run on distroless?
Anything that relies on system libraries. This works fine for most Go apps, but can have unexpected results if you don't compile the app correctly to use Go networking and what not.
I see. Regarding Go, how would forget to import the Go net and http packages for your app? I would think your compilation itself would fail to begin with. Or are you referring to something else?
> "you're on your own" is like, the expected thing when you are doing something different.

Indeed. And that's fine. As long as you're willing to support that difference.

But the "Alpine compiling XYZ against musl" thing is/was just being done blindly by Alpine (i.e. load X into auto-build and let it rip). Sure it compiled without errors. But it never ran properly.

I've rarely had issues and if I do there is a process to report them to get them fixed. Not yet mad and act like the entire distro is worthless because I can't be bothered with reporting an issue for something that is already free. I've had less issues with Alpine than I've had with software on Windows.
Are they still on to of everyone else in a meaningful way, though?

There was discussion yesterday [0] that pointed out that there are 29MB Debian [1] and Ubuntu [2] images.

[0] https://news.ycombinator.com/item?id=30633670

[1] https://hub.docker.com/layers/debian/library/debian/stable-s...

[2] https://ubuntu.com/blog/minimal-ubuntu-released

I run Alpine Linux from a 512 MB CF card, so yes.
What do you use this for?
On a Siemens Futro S-300. I use it as a Home Server. A 2-TB disk is mounted there, also a printer.
There are better distros with package managers that allow multiple variations of libc to live together.