-
-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Alpine Linux support #10
Comments
To be more specific, this is about using musl libc applications (such as those that come with Alpine Linux) as the payload inside AppImages. https://github.com/probonopd/go-appimage can do it, if you run with the Another issue is about making the AppImage runtime run on musl libc based distributions like Alpine Linux, too: AppImage/AppImageKit#1015. Any help on that issue is highly appreciated, too. |
|
@probonopd: Why not statically linking the runtime? Or is there anything stopping you from doing it? As I see, doing so would solve that problem. @azubieta: I'd like to help with this issue. I've used Alpine in the past. |
Oh, I just found this: AppImage/AppImageKit#877 (and related issues). |
To make an Alpine base AppImage we need a muslc bound or static runtime. Which is not currently available. @probonopd are there any plans for it? |
I made a prototype of this from scratch using witchery, a tool made by one of the Alpine devs for making filesystem images that contain all dependencies for an app and nothing else. Witchery is only ~150 lines of POSIX shell, so appimage-builder could either use it or re-implement it from scratch. abuild, the Alpine package building tool, and apk, the Alpine package manager, do most of the heavy lifting. Here's what my prototype does:
It's just a prototype, and the process is a bit messy now, but it's exciting to see a |
@xordspar0 do you have a downloadable example of an AppImage created with your prototype? I'd like to try it out. Thanks! |
Sure! I uploaded it here: https://github.com/xordspar0/nxengine-evo/releases/tag/alpine-inside This version isn't any smaller than the Ubuntu-based AppImage, but I think that's because I installed more dependencies than necessary in the "add libraries until all the |
Hello @xordspar0 this looks really interesting!
After that fix I got the following error, which is something I was fearing. The bundled graphic libraries are not compatible with my system. This is why AppImages are a bit "permeable" and use some of the system resources. So to make this work we should be able to allow the application load the system graphics libraries. |
Oh, that's weird. I didn't realize I had ld-musl installed on my system. Thanks for the easy fix.
Oops, that it my mistake. You may be right that it's a good idea to make the app use system graphics libraries, but that's actually not the issue you're running into. When this app prints that message, it actually means that it couldn't find the graphics assets. I forgot to compile with position-independent resource paths. Thanks for taking a look! I fixed these two issues and uploaded another image to https://github.com/xordspar0/nxengine-evo/releases/tag/alpine-inside. |
Very interesting! The basics seem to be in place - I can run the AppImage even on FreeBSD helloSystem and it doesn't explode 👍 It prints this message:
Seems to suggest that the musl part is working just fine, but something wants to write inside the AppImage, which obviously is not going to work by design. Hope this is easy to fix. When I extract the AppImage and run the I'd call this a resounding success. Speaking of sound, Congrats, this is awesome. Awesome beyond belief! Might be a good way to low-overhead truly compatible (even with FreeBSD!) AppImages. My logic being, if it can run on FreeBSD, it should run on pretty much all Linuxes. |
Now we have a runtime that can be executed in alpine linux (see: https://github.com/AppImageCrafters/appimage-runtime). But the AppRun is now the one that is dynamically linked to glibc because it uses We need to find another way of doing it. ref: AppImageCrafters/AppRun#61 |
Running postmarketOS, which is built on alpine, on my laptop, leaving comment here to get pinged for development of this issue and can test stuff if needed. |
Here's another example of my weird Alpine-based approach. https://git.sr.ht/~xordspar0/packages/tree/main/item/AppImage/srb2/build.sh
|
Very interesting @xordspar0. I like the approach to use Alpine.
At some point the newer versions of patchelf crippled binaries; if you are sure that this is no longer the case then we may consider to use the latest version in go-appimage.
I'd like to have this fixed in go-appimage, opened an issue here: |
I'm sure it's working in my case! I was going to submit a PR to update patchelf, but I saw in the git blame that it was held back for a reason. I'm using the latest patchelf from Alpine edge, 0.18. I believe go-appimage is using 0.9, if my memory is correct? I just checked if Alpine has any downstream patches. Technically there is one but it wouldn't matter for this case. https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/main/patchelf
Thank you for opening those two issues, I meant to do that but I got tired and went to bed. And for fixing them! That was quick. I tested my script again without those two hacks and everything works perfectly. |
Alpine Linux is well known for being a highly optimized solution for containerized software distribution. This also applies to AppImages. Therefore it will be a great opportunity to reduce the final AppImages size.
The text was updated successfully, but these errors were encountered: