Programmer007
Programmer007

Reputation: 87

how to check the installation location of libstdc++6 in docker image

I am unable to find where this will install libstdc++6 library in the docker image.

FROM alpine:edge

ENV LD_LIBRARY_PATH=/lib

RUN apk add --no-cache libstdc++6

Upvotes: 1

Views: 7657

Answers (2)

b01
b01

Reputation: 4384

I run: find / -name libstdc++.so

If more than 1, then evaluate environment variables PATH, and if it is set, LD_LIBRARY_PATH to see which is likely to get picked up.

Upvotes: 0

Hans Kilian
Hans Kilian

Reputation: 25414

You can start an Alpine container in interactive mode and run your commands. Then you can check where they've been installed

Something like this

$ docker run --rm -it alpine:edge /bin/sh
/ # export LD_LIBRARY_PATH=/lib
/ # apk add --no-cache libstdc++6
fetch https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
(1/2) Installing libgcc (10.3.1_git20210625-r0)
(2/2) Installing libstdc++6 (6.4.0-r12)
OK: 7 MiB in 16 packages
/ #

Then you can check what's in the /lib and /usr/lib directory

/ # ls /lib
apk                    ld-musl-x86_64.so.1    libc.musl-x86_64.so.1  libssl.so.1.1          libz.so.1.2.11         modules-load.d
firmware               libapk.so.3.12.0       libcrypto.so.1.1       libz.so.1              mdev                   sysctl.d
/ # ls /usr/lib
engines-1.1                 gcc                         libcrypto.so.1.1            libgcc_s.so.1               libssl.so.1.1               libtls-standalone.so.1      libtls-standalone.so.1.0.0  modules-load.d
/ #

Upvotes: 1

Related Questions