RUN apk upgrade --no-cache && \
apk add --no-cache libstdc++6
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++6
...
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.