-
Notifications
You must be signed in to change notification settings - Fork 528
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
GLIBC symbols not found #149
Comments
This kind of problem isn't really in scope of the Alpine Linux image. The glibc package is mostly experimental. Please try using a later version from https://github.com/andyshinn/alpine-pkg-glibc/releases and open an issue there if still have problems. A quick search reveals that some of those symbols might be from tls/libc6.so and libbacktrace. |
Hi everybody, I think it's the same problem |
Alpine Linux is based on musl, while GHC-built binaries rely on glibc. Therefore there's a bunch of weird errors when trying to run the image, like "__sprintf_chk: symbol not found". Therefore, use a glibc-based distribution like Ubuntu. The resulting image is 332MB (Ubuntu) instead of 150MB (Alpine), but it can actually run the programs, which is a huge point in Ubuntu's favor. Here's a glibc-related issue on Alpine Linux: gliderlabs/docker-alpine#149
Any advices on how to fix this? I understand this might be the wrong place to look but google sends people here. Sharing workarounds or fixes is very appreciated. |
Ok so after my investigation I realized that docker-compose stops working if Looks like there are some incompatibilities between |
I am trying to run a program inside the Alpine docker container. The machine that I am creating the Docker image and running the container has a CentOS 7.2 distribution. The application was built using the x84-64 version of GCC and not using the Musl toolchain. The program has a number of shared library dependencies including glibc.
The Dockerfile is setup to download and install glibc-2.21-r2.apk. Other libraries such as libstdc++.so are being copied from the /lib64 directory of the CentOS distribution.
I can run the application in the Docker container but 'ldd' displays potential problems:
ldd /root/ut_mac
/lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libcjson.so => /lib/libcjson.so (0x7f6ee20d2000)
libmediashm.so.0 => /lib/libmediashm.so.0 (0x7f6ee1ecd000)
libz.so.1 => /lib/libz.so.1 (0x7f6ee1cb7000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libstdc++.so.6 => /lib/libstdc++.so.6 (0x7f6ee19af000)
librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f6ee179c000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f6ee22da000)
ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f6ee1578000)
Error relocating /root/ut_mac: mallopt: symbol not found
Error relocating /root/ut_mac: backtrace: symbol not found
Error relocating /root/ut_mac: __fprintf_chk: symbol not found
Error relocating /root/ut_mac: __printf_chk: symbol not found
Error relocating /root/ut_mac: __pthread_unregister_cancel: symbol not found
Error relocating /root/ut_mac: pthread_setname_np: symbol not found
Error relocating /root/ut_mac: argp_error: symbol not found
Error relocating /root/ut_mac: __pthread_register_cancel: symbol not found
Error relocating /root/ut_mac: __isnan: symbol not found
Error relocating /root/ut_mac: backtrace_symbols_fd: symbol not found
Error relocating /root/ut_mac: argp_parse: symbol not found
Error relocating /root/ut_mac: srandom_r: symbol not found
Error relocating /root/ut_mac: __sprintf_chk: symbol not found
Error relocating /root/ut_mac: initstate_r: symbol not found
Error relocating /root/ut_mac: __snprintf_chk: symbol not found
Error relocating /root/ut_mac: __strtok_r: symbol not found
Error relocating /root/ut_mac: random_r: symbol not found
Here is the Dockerfile:
FROM alpine:latest
COPY libcjson.so libmedia* libstdc++.so.6.0.19 /lib/
COPY mim* ut* /root/
RUN apk update &&
apk add --no-cache ca-certificates &&
wget "https://circle-artifacts.com/gh/andyshinn/alpine-pkg-glibc/6/artifacts/0/home/ubuntu/alpine-pkg-glibc/packages/x86_64/glibc-2.21-r2.apk" &&
apk add --allow-untrusted glibc-2.21-r2.apk &&
rm glibc* &&
/usr/glibc/usr/bin/ldconfig /lib /usr/glibc/usr/lib &&
ln -s /usr/glibc/usr/lib/ld-linux-x86-64.so.2 /lib/ld-linux-x86-64.so.2
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: