Praise for Alpine Linux
portal.drewdevault.com
portal.drewdevault.com
Is there a guide to how Alpine is architected and put together? From this description it sounds like it could be a pretty interesting intro to how a basic Linux distro operates.
Otherwise, I'd recommend installing Alpine in a VM and play with it for a week. On a lower level, alpine-base[1], alpha-baselayout[2], and alpine-conf[3] might be a point of interest. alpine-conf contains several scripts for bootstrapping the entire system (e.g. setup-disk/setup-bootable/update-kernel). Following what these scripts does can get very far into understanding how a distro is put together.
[1]: https://git.alpinelinux.org/aports/tree/main/alpine-base/APK...
[2]: https://git.alpinelinux.org/aports/tree/main/alpine-baselayo...
I wonder why alpine became he defacto super slim base image over void?
Latest Alpine for comparison is 10 times smaller then void-musl. From what I remember Alpine by default is just smaller and more granular. If you really want to cut things down I'm sure Alpine is the best choice. Other notable difference would be with init system. Alpine with OpenRC is probably more conventional with many service scripts written for it. Void-Linux with runit is just a different blend. It is not hard to write service scripts for runit, but probably there are more scripts written for OpenRC so it's a win.
For me a big plus of Void is its build system, but I can't comment on how it compares to Alpine, because I don't know the latter. It is quite easy to add more packages all with proper cross-compilation support and builds are thinly isolated by default with unshare (but it can use bubblewrap). I am slowly implementing my own distribution based on Void, that will have ChromeOS-like updates (AB partition scheme). I want it to replace ChromeOS on my chromebooks and also have it as the OS for computers I manage for my family.
EDIT: Also as sibling commenter noted it is rolling only. It is a problem for my project that I would like to address by issuing updates only when critical software has newer versions (i.e. Firefox) and check packages against CVE database. I have seen this CVE checking on Gentoo, I'm not sure if it is cvechecker or something around eselect. Other possibility for me would be to freeze versions in step with some other stable distribution.
EDIT2: It was glsa-check tool from Gentoo.
Another point for flatpak/snap style proprietary apps distribution though - they don't assume anything about the distro will be there.
Also, dealing with DNS issues in Alpine based containers (which was caused by musl implementation, iirc) was one of my biggest nightmare at work. Just search for "Alpine+DNS" on Google and you can see what a mess it had brought.
As for DNS, it's extremely unfair to blame musl for properly implementing the POSIX standards for name resolution. It's not Alpine's fault that so many people wrote software which explicitly depended on specific glibc quirks. If anything, it's a good lesson on the dangers of monocultures, and how even FOSS software is at risk.
What I was trying to say, was that many people choose it for wrong reasons without fully understanding the implications. This included us. It was a nightmare to me because at that time I didn't know it has different behavior in DNS resolution. And our developers expected their code, which ran fine on their workstations and in CI (Ubuntu/Debian environments), to behavior the same when running in an alpine container in production.
This, I remember jemalloc and musl/ Alpine issues. In the end it just isn't worth the hassle. Although that was may be two years ago.
I don't base any decisions around micro benchmarks but that example struck me as interesting because this was a case where the performance difference between using Alpine and Debian was real and affected user level applications.
For the last few years I also run Debian Slim for my base Docker images and don't worry about it.
Yes my images might be a little larger than Alpine but it's non-issue in the real world. For smaller scale deploys once the base image is pulled down initially it's there in both cases, so now it comes down to pulling app level changes (code or package deps) which is comparable in size with both distros.
And for huge scale deployments it doesn't matter because typically you'd use custom ISOs with as much pre-loaded static content as possible, so you could easily bake in a specific Debian Slim image into the ISO so when you pull down your application image at deploy time it skips having to pull the base image entirely negating any wins that Alpine might have had for pull speeds and network usage.
Sure Alpine has less attack surface since it's a smaller code base but we're comparing it to Debian here. They have a 28 year track record of being unbelievably dependable and well supported.
But that's a pretty bad idea in most cases I guess. Good to see that Musl might be supported properly.
I don't think it's any sort of Mac generation downvoting, I think it's more the opposite: they're preaching to the choir. Yea. We Know.
Not is it just acceptable, it's your obligation to tell peoples what the downside (or upside) of closed down software is. Is a closed source webserver a good idea? probably not. Is THE closed source Photo-editing program a good idea? Probably yes....if you really need it.
To contradict myself: I do find myself frustrated when 'obvious thing that should work' doesn't but I save that ire for things that break between versions!
I am really against the idea that just because something is "free", it is exempt of any judgment. We should always strive to improve everything, free or not.
I've got 2 installer setups I use: a pretty much stock base install and a "replace all of the BusyBox versions with real versions" install that is still quite tiny. I used to have a 3rd "desktop" setup for my laptops but I found too many issues compared to running e.g. arch at that point so I stopped using it.
Once in a while I'll still install Ubuntu server when dealing with proprietary stuff or whatnot buy beyond that Alpine has been my go to for years now.
I wonder what the pitfalls and corner cases he encountered are when he set it up. I envisage an Arch style process of configuring and tweaking the system.
I think that could be a worthwhile project documenting the setup for my personal use case.
Documentation is a separate package so unless you're careful to always install it you tend to not have it.
Busybox is definitely not 100% compatible with coreutils, lots of sloppy scripts tend to break.
For a while the default kernel was the grsec one which breaks pretty much everything. Thankfully that seems to have changed.
musl libc lacks some of the new instrumentation and bounds checking features in glibc, also the subtle differences can change how often bugs in incorrect programs get triggered. Of course musl libc is not binary compatible so closed source software won't work. (no widevine or chrome)
Some larger packages are missing, I don't know if they ever managed to package Gnome (I certainly don't blame them, it's a beast.)
OpenRC is not systemd, I prefer it though.
They have an an installation option that lets you run from tmpfs but back up /etc and automatically reinstall packages from a disk cache on reboot. This is great for that generation of macbook pro with the bad harddisk cable, mine had 8gb of ram which is plenty with a small distro like alpine as long as you're used to keeping everything in git and pushing often to branches on other machines.
Install the "docs" (meta)package and it'll automatically install documentation packages. My greatest annoyance is actually the (absent) documentation to find this; IIRC I had to find out about this via IRC.
Personally, I’m happy with a little excess on my personal systems, documentation is a must for me, but it’s a great reminder that I’d need to pull it in separately.
I’m very interested in exploring the “home directory as a git repository” metaphor I’ve seen written up here from time to time, perhaps a minimal system like Alpine is a good opportunity to explore it further.
I’ll play around with it. Thanks!
For a while we would pin library versions (e.g. libvips) only to have the pin break the build because the package was no longer provided. That’s only a few months later, not years. It seriously impacts the repeatability of Docker builds.
Now we don’t pin to the same extent and lack some confidence, but at least it doesn’t break the build.
No broken builds but all times displayed from our alpine based services were off by an hour.
The best bit was that users started entering times for scheduled events that were off by an hour to "compensate" for our brokenly displayed times.
This is (almost self-evidently) true in theory, but not really in practice. It's about finding the sweet spot between LTS and maintainability. As the commenter said:
> only a few months later, not years
The lifecycle is usually longer with other distros.
Easy enough to throw a your pinned packages into s3, or anywhere else that's convenient.
On amd64 desktop/server I still default to Ubuntu. For Docker my image base is usually Alpine.
But what’s really amazing is that recently I’ve transferred more and more functionality to my Nvidia Jetson AGX.
While the CPU could certainly be newer the 32GB of shared memory, NVMe storage, and CUDA GPU support is just killer for my use cases.
Docker images and LXC containers for Home Assistant, my broadcastify scanner feed, my ADSB feed, my Plex server, my FreeSWITCH instance, and my various NLP/TTS/STT applications (with CUDA) make the Jetson AGX perfect for me.
Where Alpine comes into play is the amazing package selection for aarch64. My life would be much more difficult without Alpine on this hardware.
With the push towards aarch64 everywhere this will get easier over time but for now Alpine is saving me a lot of headaches!
As much as I hate to say it, I'd take a glibc flavor of Alpine as a daily driver in a heartbeat.
I am also curious about the "apk is seriously robust" comment: does this mean fast, stable, intuitive... or something else? If the package manager achieves it's goal I don't care about "robustness" as long as I'm not losing 10+ hours a week trying to debug something about it.
> OpenRC is not as good, but thankfully it's slated to be replaced in the foreseeable future.
I am really curious and couldn't find information on the web. Change to what?
The OS/distro is sane, reminds me of OpenBSD that way.
The majority of my NixOS configuration is written in NixOS agnostic modules so it works pretty well.
I share my NixOS configurations between one bare metal Alpine install as well as an Alpine WSL2 install.
I'd really disagree here. Two choices that Alpine made can be really nasty to debug or work around if you are unaware of using Alpine - especially if you're extending from some Docker image that extends from another Docker image that has Alpine as core:
1. musl libc. It's not binary compatible with libc and many Docker image builders don't bother to ship the libc-compat package which means if you're adding (for example) some Java library that has native parts depending on libc, you'll get weird errors.
2. busybox as default shell instead of a real bash. Way too many external scripts depend on various degrees of bash features.
Simple means "not complex."
Busybox shell and musl are both less complex than bash and glibc.
For someone developing new features for these projects, yes. For someone used to classic bash/libc as a user? The other way around, because one has to keep subtle differences in mind.
I would interpret “no handholding” to mean “easy to implement”.
As I understand it - Simple, as a term of art, doesn’t often mean easy. Simplicity is elegance in design, though not necessarily elegance in implementation.
The implementer, developer, is one person (or a handful of people). As a general rule, since there a lot more users than developers, we should lean towards making lives easier for users.
Software is used a lot more than it is written.
[1]: https://wiki.alpinelinux.org/wiki/Alpine_local_backup
[2]: https://wiki.alpinelinux.org/wiki/Qemu#Live_mode (would be similar to this)
Am struggling with a x205ta and would love to have a workstation running alpine and no containers.
And be it just for the lulz.
On similar distros, Void is great, albeit LibreSSL would be preferable to OpenSSL.