sgerrand / alpine-pkg-glibc

A glibc compatibility layer package for Alpine Linux
2.05k stars 280 forks source link

Running AppImage #153

Closed anki-code closed 3 years ago

anki-code commented 3 years ago

Hi!

Is there a way to run AppImage with alpine-pkg-glibc on Alpine?

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

anki-code commented 3 years ago

Yes! It works! My first try with the xonsh shell:

# here most of special flags is to allow using FUSE in docker
docker run -it --rm --cap-add SYS_ADMIN --device /dev/fuse \
    --security-opt apparmor:unconfined --cap-add MKNOD alpine /bin/sh

# Download xonsh
wget https://github.com/xonsh/xonsh/releases/download/0.9.27/xonsh-x86_64.AppImage
chmod +x xonsh-x86_64.AppImage

# First try without alpine-pkg-glibc
./xonsh-x86_64.AppImage 
# /bin/sh: ./xonsh-x86_64.AppImage: not found

# Install alpine-pkg-glibc (from README)
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk
apk add glibc-2.33-r0.apk

# Second try with alpine-pkg-glibc
./xonsh-x86_64.AppImage
# ./xonsh-x86_64.AppImage: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

# Locales (from README)
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-bin-2.33-r0.apk
wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-i18n-2.33-r0.apk
apk add glibc-bin-2.33-r0.apk glibc-i18n-2.33-r0.apk
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8

# Third try
./xonsh-x86_64.AppImage
# dlopen(): error loading libfuse.so.2
# AppImages require FUSE to run. 
# You might still be able to extract the contents of this AppImage 
# if you run it with the --appimage-extract option. 
# See https://github.com/AppImage/AppImageKit/wiki/FUSE 
# for more information

# Test extraction
./xonsh-x86_64.AppImage --appimage-extract
# Working!

apk add fuse
apk add bash   # to avoid "execv error: No such file or directory"

# Fourth try
./xonsh-x86_64.AppImage
# Welcome to the xonsh shell (0.9.27.dev16) 

It works! Thanks!