11 ms·
Adventures in Creating a Minimal Alpine Linux Installer
- peter_d_sherman 4y agoGreat article! You know, I would love to see an "Alpnix" in the future -- all of Alpine's speed and lightness, all of NixOS's hermetic and reproducible build capabilities...
- MuffinFlavored 4y ago> NixOS is a Linux distribution built on top of the Nix package manager Can the Nix package manager not be added to Alpine? I guess you'd have to replace apk?
- yjftsjthsd-h 4y agoI think they're actually asking for the other way around; they want nixpkgs packages that are as light on disk space as alpine, which probably needs some config tweaks (which nix lends itself to) and possibly using musl (which I think you just do with an overlay? I know it's doable, but I'm not familiar)
- qbasic_forever 4y agoapko is close to that, it's a tool to build fully reproducible Alpine Linux containers from a declarative YAML description: https://github.com/chainguard-dev/apko https://github.com/chainguard-dev/apko
- euclaise 4y agoI really like Alpine, even as a desktop OS. musl is a downside but I guess flatpaks and whatnot help that
- squarefoot 4y agoWhat problems did you encounter? I installed Alpine on some laptops for desktop use and never had a problem except with one HP small netbook where the energy management seems broken as the kernel rewrites somewhere the screen backlight value with a value of 4 (= almost invisible) as soon as I pull the DC plug but doesn't update it when I plug it back. This also happens with ACPI and all power management uninstalled, so I sorta solved this by installing ACPI and making scripts to echo the right value back. This problem aside, I could install a lot of non trivial things, including for example WINE and Yabridge to use music plugins. Unless the system pulled them unbeknownst to me, I made no use of flatpaks and the like. The more I use Alpine, the more I like it.
- LoganDark 4y ago> What problems did you encounter? I personally found it difficult to get Nvidia drivers & Steam working. The latter worked with flatpaks, but Nvidia is always annoying. Yes. You may laugh at me for trying to use Linux on a computer that was not built for it.
- squarefoot 4y agoOne of my favorite quotes, no idea about the author or the date, is "discoveries are made by not following instructions". Laughing because you're trying to get more from a machine that is built to give less would be really stupid; that is actually clever and admirable, and when one succeeds it gives extreme satisfaction. As for Nvidia drivers I can't help because my last experience with their cards is quite old, possibly older than the Nouveau drivers, but keep trying; it couldn't be a Alpine Linux failure as Nvidia, according to a famous Linus Torvalds quote, has already been less than friendly to Linux developers in the past.
- LAC-Tech 4y agoI bought a barebones PC specifically for my linux work station. One criteria from the outset was no NVIDIA.
- euclaise 4y agoCan't have CUDA without nvidia, and can't have nvidia without glibc
- stonogo 4y agoIt's funny what different people find interesting in Alpine. I started using it expressly because it uses musl. Void is a distro with similar principles that offers a glibc version, so I use that when I need GNU.
- sph 4y agoWhat's the benefit of musl that you don't get with glibc?
- LoganDark 4y agomusl is statically linked, so each binary can update at their own leisure. There are no system-wide libc updates to break anything.
- MuffinFlavored 4y agoHow much space is added to each app to include the needed parts of app-level libc?
- netr0ute 4y agoI don't know, but for statically linked glibc, it adds a couple megabytes to each binary that uses it. That may or may not be great if you're concerned about cache optimization, which is one big reason why dynamic linking is still so popular.
- ComputerGuru 4y agoglibc doesn't actually support statically linking. (You can force it, but it breaks things.)
- anyfoo 4y agoYep. There's a reason why macOS and iOS have a giant (easily 1GB) "shared cache" that is most of the libraries that make up the OS in a giant file, mapped into every process's address space. Without shared linking, in your example you end up with a copy of glibc and whatever else in every process. Without some fancy page deduplication scheme (that would come with its own set of problems), the kernel cannot know that all these pages in all these processes are the same. And they might not even be, because different versions and just the process of static linking itself might make an arbitrary number of them look slightly different. Not every program needs all of glibc, so not all of it will be paged in, but still, it looks like you will pollute your CPU caches with many copies of essentially the same thing.
- alexklarjr 4y agoWow, magical linux distro that cut Firefox memory usage in half.
- Sirened 4y agoYeah I was similarly unimpressed with their methodology. Like...a single pie chart listing the results of top sorted by physical memory would have provided meaningful insight both as to why Alpine supposedly uses less memory as well as how valid the results are.
- nikau 4y agoNext they should do a pie chart of devops time wasted with busybox and libc triggered issues. Alpine is cancer.
- LoganDark 4y agoI would like to see a glibc version of Alpine. My favorite feature (the killer feature) of Alpine is that rootfs is not persistent. Persistent storage actually only contains the base system itself and each package you install. On startup, the system is loaded into a tmpfs and all your packages are loaded on top of it. I've successfully created a desktop install using this method, it boots off a USB stick and the only persistent partition is /home. I find the cleanliness of this extremely impressive. IIRC, it only works this way if you don't use the official installer, which wants to make a persistent rootfs. I feel like Alpine has shown me "true level" [0] and I feel dirty using any distro with a persistent rootfs... in fact it's the single largest reason why I haven't felt motivated to try Linux in a while (aside from KISS since it was interesting enough). There are no other distros like this, so the fact that it uses musl is a little disappointing if I want to use it as a desktop (which I know it's not designed for). NixOS comes close, but is fully declarative and I don't really want to learn a new DSL today. I should probably just settle and go with Arch or something. [0]: https://www.youtube.com/watch?v=Q1zBtJhgwBI https://www.youtube.com/watch?v=Q1zBtJhgwBI
- Rediscover 4y agoRegarding the persistent storage, is that anything like PuppyLinux [0] ? Boot off of something (eg, usb drive), it loads the first layer (ro) into tmpfs, then the 2nd-X layers (also ro) over that, and finally a read/write layer of your saves (/home, config changes under /etc, ...), remove boot medium, eventually do a save to some medium. [0] https://puppylinux.com https://puppylinux.com which redirects to https://puppylinux-woof-ce.github.io/ https://puppylinux-woof-ce.github.io/
- silisili 4y agoHave you considered something like Fedora Silverblue?
- LoganDark 4y agoI have, but never got around to trying it. I plan to try Kinoite too, since it's just Silverblue but with KDE Plasma. Maybe I'll actually get around to it.
- ffhhj 4y agoIs there a distribution of Alpine Linux under 50MB (terminal only), iso or raw image, with APK intalled? Every minimal Linux installer brings Busybox without a proper package manager.
- yjftsjthsd-h 4y agoI don't understand what you're asking for. Alpine is a Linux distro, and any version of Alpine will have apk, which is a proper package manager. If you just want Alpine with a smaller disk footprint, the big problem is actually drivers, but you can work around that by removing what you don't need. In fact, it appears that the "virt" image - https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/alpine-virt-3.17.0-x86_64.iso https://dl-cdn.alpinelinux.org/alpine/v3.17/releases/x86_64/... is 49MB, so unless I missed something, what you're asking for exists?
- LinuxBender 4y agoAs someone that uses Alpine on literally everything except for a desktop I think this is great and would love to see it contributed upstream and integrated by the Alpine developers to be a fully supported installer option.
- yjftsjthsd-h 4y agoIf you're willing to set things up yourself, Alpine is already a pretty good desktop OS. Not that I'd object to also getting preconfigured desktop flavors, granted.
- LinuxBender 4y agoI completely agree. The reason I would like to see such creations contributed upstream is that it could potentially make adoption greater.
- butz 4y agoHas anyone tried running Linux without xorg/xwayland, only pure Wayland?