Closed pierredavidbelanger closed 7 years ago
Ho, I am sorry, I think I know.
I guess libstdc++.so.6
is not found because my Dockerfile is FROM java:8-alpine
.
I will try with an other base image and see if I still have this problem.
Ok, so, my problem was indeed an issue with alpine
.
The fact that alpine
is using musl-libc must somehow be the root cause.
My app is now working if I base my Dockerfile FROM openjdk:8
.
The side-effect of this is that my image is now really bigger:
REPOSITORY TAG IMAGE ID CREATED SIZE
new_app latest xxxxxxxxxxxx 23 seconds ago 678.6 MB
app latest xxxxxxxxxxxx 4 days ago 166.7 MB
FWIW, an other interesting way to fix this problem (and stay with alpine
) is to install the libstdc++
package, like this:
FROM java:8-alpine
...
RUN apk add --no-cache libstdc++
...
At runtime, libjunixsocket-native
will find what it wants:
$ ldd /tmp/libjunixsocket-native-2.0.45373916279860178862.so
ldd (0x56432e94b000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7fcaba3d3000)
libm.so.6 => ldd (0x56432e94b000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fcaba1c0000)
libc.so.6 => ldd (0x56432e94b000)
But I do not know what other problems this fix could cause, because from what I can see, java
is still linked to musl:
$ ldd /usr/bin/java
...
/lib/ld-musl-x86_64.so.1 (0x564ed8a3f000)
...
Anyways, I will stop spamming this thread, everything is working for me now.
junixsocket 2.2.0 now ships with two separate libraries, one that links against glibc, and one that doesn't.
In other words, try with 2.2.0 on Alpine Linux with a Java runtime that uses musl, and see if you still need the libstdc++ dependency.
This page still receives a significant amount of traffic. Which means that whatever software you're using depends on a very outdated junixsocket version.
Please upgrade your junixsocket dependencies to 2.8.3 or newer. If you are unable to do so, or don't know how to do that, open a new issue with details about the environment you're seeing this error in.
Thanks for your help!
I am using docker-java in an application that runs inside a container, to access the host
/var/run/docker.sock
(mounted as/var/run/docker.sock
inside the container with-v /var/run/docker.sock:/var/run/docker.sock
).I am unable to connect, here is the interesting part of the stacktrace: