maven-mvnd icon indicating copy to clipboard operation
maven-mvnd copied to clipboard

Support for musl library on linux-amd64 (Alpine)

Open Raul1718 opened this issue 3 years ago • 6 comments

image

Raul1718 avatar May 07 '22 03:05 Raul1718

Do you have a docker image to reproduce the problem ?

gnodet avatar May 13 '22 08:05 gnodet

Dockerfile add RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

walnut-tom avatar May 14 '22 06:05 walnut-tom

Dockerfile add RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

Adding the link to the musl library still leads to an error:

~ # ./mvnd-0.8.0-linux-amd64/bin/mvnd
Error relocating ./mvnd-0.8.0-linux-amd64/bin/mvnd: __strdup: symbol not found
Segmentation fault

This looks similar to https://github.com/SAP/node-rfc/issues/148. Either mvnd client and the native library have to be compiled and linked with musl, or glibc needs to be installed on the alpine box.

gnodet avatar Sep 08 '22 09:09 gnodet

here a graalvm in alpine https://github.com/renanpalmeira/docker-graalvm-alpine/blob/master/Dockerfile

walnut-tom avatar Sep 13 '22 10:09 walnut-tom

here a graalvm in alpine https://github.com/renanpalmeira/docker-graalvm-alpine/blob/master/Dockerfile

This looks a bit outdated as GraalVM location has changed (and version is now 22), but it may be used as a basis. I found the following thread FTR: https://github.com/oracle/graal/issues/1898#issuecomment-763275747 which points to this gist https://gist.github.com/sify21/2eec007e4b05d448c85192fc279232c6

gnodet avatar Sep 13 '22 11:09 gnodet

Dockerfile add RUN mkdir /lib64 && ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2

Adding the link to the musl library still leads to an error:

~ # ./mvnd-0.8.0-linux-amd64/bin/mvnd
Error relocating ./mvnd-0.8.0-linux-amd64/bin/mvnd: __strdup: symbol not found
Segmentation fault

This looks similar to SAP/node-rfc#148. Either mvnd client and the native library have to be compiled and linked with musl, or glibc needs to be installed on the alpine box.

https://wiki.alpinelinux.org/wiki/Running_glibc_programs

apk add gcompat

It work for me

zhaoyuehao avatar Oct 10 '22 09:10 zhaoyuehao