5 ms·
Setting up a packaging environment for Alpine Linux (introducing alpkg)
- oliv3r 4y agoShameless plug, but I've done the same as the author a couple of years ago, but _have_ used docker. Docker is just chroot on steroids right? Not sure what the persistent storage requirement is about, but what I do, after installing my tool https://gitlab.com/esbs/package_builder-alpine/ https://gitlab.com/esbs/package_builder-alpine/ ``` git clone <aports repo>.git # Only needed once obviously cd aports [cd <pakage subdir] [TARGET_ARCH='x864_64']package_builder_alpine.sh [/bin/sh] ``` And that's it. The bringup-teardown of the container take a little time, so you can launch a shell instead, and call `package_builder_alpine.sh` within the shell. The script will generate (temporary) keys if it cannot find them in the mounted volumes. But even this can take some time, and so after running it once, to generate the keys etc, one can then just use the standard abuild tools, to make debugging faster. In a second editor, on the local host, one can use any OS as per normal, e.g. git, vi, etc.
- moondev 4y agoMy heart skipped a beat when "ls" failed. The intro and all the background detail on motivation was great.
- InitEnabler 4y agoMine was at when /dev was deleted. oof.
- stuff4ben 4y agoIs there really a reason to use Alpine anymore? There's RedHat's UBI-minimal/micro and Ubuntu has a minimal image. Especially with Alpine's DNS weirdness in K8s environments. I feel the whole "Debian/Ubuntu bloatedness" (from the blog) is so last decade nowadays.
- rediculous400 4y agoI still believe there are some (i agree not many) reasons to still use Alpine Linux. The obvious is the small size i think still maybe even smaller than Ubuntu. But more importantly the security, it focuses on security with features such as stack-smashing protection, address space layout randomization, and a hardened kernel. And isn't performance still decent for being lightweight and fast? And of course the package management apk manager. Isn't it smaller package repository than other distributions still?
- klooney 4y agoRedHat also does a ton of hardening (ASLR since 2004), and they employ the people that wrote most of the implementations. They've historically been quite good and fast with security updates, and are one of the vendors that gets the inside track on security embargoes. They're also really slow and stable, which is nice for boring plumbing.
- sebazzz 4y agoHow much of these security hardening matters in a container?
- blueflow 4y agoAn application running in a container is still an application running in userspace, so the hardening applies as normal.
- csdvrx 4y ago> Is there really a reason to use Alpine anymore? There are already many reasons. As cosmopolitan advances, there will be even more: think about what you could do with a set of binaries that would run anywhere. That'll happen way sooner with a muslc based distribution than with any other libc, and there aren't many muslc distributions as popular as alpine (except Void): https://wiki.musl-libc.org/projects-using-musl.html https://wiki.musl-libc.org/projects-using-musl.html
- b33j0r 4y agoGreat name! They used to say that “naming things is the hardest problem in computer science,” but now that we’ve settled on the Llamas sketch and other woolen domesticated quadrupeds for puns… I believe we have a closed-form solution. I call “The Larch” for my next project.
- artogahr 4y agoGreat article, and let me take a moment to say, great website design. Especially on mobile.
- alpine_linux 4y agoThanks! I use Alpine as a daily driver and will add it to my workflow here: https://github.com/git-sgmoore/AlpineLinux-DailyDriverDesktop https://github.com/git-sgmoore/AlpineLinux-DailyDriverDeskto...
- csdvrx 4y agoVery interesting - after having some zfs issues these last few days I've been living in the console to learn more things and it's an interesting experience! (though on arch not alpine) For some specific workflows I think it's a viable daily driver.
- InitEnabler 4y agoWhat kind of issues? A PR I wrote was merged not too long ago addressing detection of drive labels (Which I discovered while trying to reference drives by-id in zfs): https://gitlab.alpinelinux.org/alpine/mdev-conf/-/merge_requests/3 https://gitlab.alpinelinux.org/alpine/mdev-conf/-/merge_requ...
- csdvrx 4y agoThe NVMe being kicked out of the PCI bus, which has been blamed on the firmware. It plays a role, but doesn't happen on other filesystems after simple tweaks, so now I believe there are 2 distinct issues at play with one of them specific to ZFS. I've also seen other reports of the same issue, but for a different NVMe device.
- znpy 4y ago> I especially like to follow this approach for Rust applications because the sizes of traditional (glibc) distro containers like Debian/Ubuntu can go up to 200-300MB due to bloat whereas Alpine (musl) containers can stay so minimal such as only 3 MB! stuff like this make me think the author hasn't really understood how containers work. 200 megabytes, so what? you're only going to download those the first time for the base layer. all other times you'll likely be reusing the base layer and only download your own layer (depending on a few things, like the tag for the image you're using). oh and by the way, musl libc can fail in mysterious ways. a while ago there was a post by someone who had almost gone mad because gethostaddr/getaddrinfo in musl libc would fail at resolving a (valid and existing) dns record in some circumstances, returning NXDOMAIN without much fuss (warning or anything).
- yjftsjthsd-h 4y ago> 200 megabytes, so what? you're only going to download those the first time for the base layer. The first time, and every time the base layer is updated, or any of the other layers under your application is updated. Sometimes you might not care, but I think that saving users a 200-300MB download on first use (and per base layer update) is still a great goal.
- deleted 4y ago[deleted]
- thinking001001 4y agoJust want to add that you can also create a full Alpine Linux filesystem with Alpine's official "apk-static" (statically compiled version of apk) and then run it as a container, with automatic network configuration, using systemd-nspawn. There is a guide someone online, I believe. This would be stateful like a chroot, but with a bit more sandboxing features, which may be desirable.
- effnorwood 4y ago[dead]