Adding shared object libraries in distroless image

1,187 views
Skip to first unread message

sathya2025

unread,
Mar 24, 2021, 4:31:55 AM3/24/21
to Distroless Users
Hi All

We are build a JVM distroless image and facing the below issue on executing basic java commands

Error: failed /usr/lib/jvm/sapjvm_8/jre/lib/amd64/server/libjvm.so, because libstdc++.so.6: cannot open shared object file: No such file or directory

We understand that distroless images wont contain shared object libraries, but want to know how to include the shared libraries in distroless images.

Regards
Sathya

Evan Jones

unread,
Mar 24, 2021, 8:52:34 AM3/24/21
to distrole...@googlegroups.com
The approach I have used in the past is to figure out what debian packages include the shared libraries you need, and add the commands to the Dockerfile I use to build an image to download and unpack the specific .deb files that I need.

In the case of libstdc++ though, you are in luck: the "cc" image includes it for you already, since it is designed for c++ applications: https://github.com/GoogleContainerTools/distroless/blob/a8b7fa0fc587ec52a0a2ae99e4544907d357e302/cc/BUILD#L16


--
You received this message because you are subscribed to the Google Groups "Distroless Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to distroless-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/distroless-users/19998f25-60df-4e51-b6ec-d819eb4ed798n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages