lambgeo / docker-lambda

AWS Lambda friendly GDAL Docker images and AWS Lambda layer
MIT License
124 stars 18 forks source link

Run patchelf on all libs #75

Closed jasongi closed 8 months ago

jasongi commented 8 months ago

Alternative solution to #74 that fixes #71 and I think fixes #56 too.

jasongi commented 8 months ago
docker run --pull always --platform=linux/amd64 --entrypoint "" --rm ghcr.io/jasongi/lambda-gdal:3.8 bash -c 'ldd /opt/lib/*.so | grep "sql\|:" | grep -B 1 "sql" '

output

/opt/lib/libgdal.so:
    libsqlite3.so.0 => /opt/lib/libsqlite3.so.0 (0x00007f84c27b4000)
--
/opt/lib/libgeotiff.so:
    libsqlite3.so.0 => /opt/lib/libsqlite3.so.0 (0x00007f6830946000)
--
/opt/lib/libproj.so:
    libsqlite3.so.0 => /opt/lib/libsqlite3.so.0 (0x00007f5ff3e2d000)
/opt/lib/libsqlite3.so:
jasongi commented 8 months ago

Files in the lib directory don’t need the ../lib as a part of relative path because they are in the lib directory’s already. Files in the bin directory do need the ../lib because they are in the bin directory

On Thu, 1 Feb 2024 at 11:48 pm, Vincent Sarago @.***> wrote:

@.**** commented on this pull request.

In dockerfiles/Dockerfile https://github.com/lambgeo/docker-lambda/pull/75#discussion_r1474689552:

@@ -399,6 +399,7 @@ RUN rm -f $PREFIX/lib/libturbojpeg.so* \

FIX

RUN for i in $PREFIX/bin/; do patchelf --force-rpath --set-rpath '$ORIGIN/../lib' $i; done +RUN for i in $PREFIX/lib/.so; do patchelf --force-rpath --set-rpath '$ORIGIN' $i; done

I'm not sure to remember everything here but can you tell why there is a difference between $ORIGIN/../lib and $ORIGIN ?

— Reply to this email directly, view it on GitHub https://github.com/lambgeo/docker-lambda/pull/75#pullrequestreview-1856846733, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA7Z3ZFV3FCUZLHVLGPTSHLYRO2MPAVCNFSM6AAAAABB3LN4XOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQNJWHA2DMNZTGM . You are receiving this because you authored the thread.Message ID: @.***>