sgerrand / alpine-pkg-glibc

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

alpine still use musl libc instead of glibc after the glibc apk file installed #172

Closed zkhzkhz closed 1 year ago

zkhzkhz commented 2 years ago

bash-5.0# apk info glibc glibc-2.32-r0 description: GNU C Library compatibility layer

glibc-2.32-r0 webpage: https://github.com/sgerrand/alpine-pkg-glibc

glibc-2.32-r0 installed size: 9404416

now glibc installed

bash-5.0# ldd --version musl libc (x86_64) Version 1.1.24 Dynamic Program Loader Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname

sgerrand commented 2 years ago

Hello and thank you for reporting this issue. I strongly suspect that this is caused by /usr/bin/ preceding /usr/glibc-compat/bin/ in your shell's $PATH.

Would you please output the value of $PATH from this instance and share it. If you're using a Docker image for this instance, would you also please share the content of your Dockerfile.

Philip-Traynor commented 1 year ago

HI, I am getting the same issue. Dockerfile: USER root

RUN apk --no-cache add ca-certificates wget RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk RUN apk add --force-overwrite glibc-2.28-r0.apk

RUN apk add gcompat

ENV PATH="/usr/glibc-compat:$PATH" RUN echo $PATH

PATH: /usr/glibc-compat:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

ldd --version musl libc (x86_64) Version 1.2.3 Dynamic Program Loader Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname

I do not have a bin subdirectory in glibc-compat, so I only set the new value in PATH to be /usr/glibc-compat

sgerrand commented 1 year ago

@PhilTraynor, please install the glibc-bin package to have /usr/glibc-compat/bin/ldd installed. If you don't have /usr/glibc-compat/bin present in your PATH, either add it or execute /usr/glibc-compat/bin/ldd directly.