Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bridge: add check for missing dynamic libs #1517

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

svix-onelson
Copy link
Contributor

The v1.39 tag on docker hub currently fails with:

docker run --rm -it -e SVIX_BRIDGE_CFG='{}' docker.io/svix/svix-bridge:v1.39.0
svix-bridge: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory

This diff adds script to look at the output from ldd and see if there are libs that aren't found.

The version of the Dockerfile in main currently seems to pass this check. Removing the cacert install gets us back to a failing state, so we can see the script working:

Step 17/22 : USER appuser
 ---> Using cache
 ---> 80f72cf25adf
Step 18/22 : COPY --from=build /app/target/release/svix-bridge /usr/local/bin/svix-bridge
 ---> Using cache
 ---> 1bcafc142c09
Step 19/22 : COPY scripts/check-deps.sh /usr/local/bin/check-deps.sh
 ---> bc8108762915
Step 20/22 : RUN /usr/local/bin/check-deps.sh /usr/local/bin/svix-bridge
 ---> Running in 31cae75a107d
Binary /usr/local/bin/svix-bridge missing dependencies:
        libssl.so.3 => not found
        libcrypto.so.3 => not found
The command '/bin/sh -c /usr/local/bin/check-deps.sh /usr/local/bin/svix-bridge' returned a non-zero code: 1

This should help to catch other dependency-related problems that will show up at runtime.

@svix-onelson svix-onelson requested a review from a team as a code owner November 11, 2024 19:34
The v1.39 tag on docker hub currently fails with:

```
docker run --rm -it -e SVIX_BRIDGE_CFG='{}' docker.io/svix/svix-bridge:v1.39.0
svix-bridge: error while loading shared libraries: libssl.so.3: cannot open shared object file: No such file or directory
```

This diff adds script to look at the output from `ldd` and see if there
are libs that aren't found.

The version of the Dockerfile in main currently seems to pass this
check. Removing the cacert install gets us back to a failing state, so
we can see the script working:

```
Step 17/22 : USER appuser
 ---> Using cache
 ---> 80f72cf25adf
Step 18/22 : COPY --from=build /app/target/release/svix-bridge /usr/local/bin/svix-bridge
 ---> Using cache
 ---> 1bcafc142c09
Step 19/22 : COPY scripts/check-deps.sh /usr/local/bin/check-deps.sh
 ---> bc8108762915
Step 20/22 : RUN /usr/local/bin/check-deps.sh /usr/local/bin/svix-bridge
 ---> Running in 31cae75a107d
Binary /usr/local/bin/svix-bridge missing dependencies:
        libssl.so.3 => not found
        libcrypto.so.3 => not found
The command '/bin/sh -c /usr/local/bin/check-deps.sh /usr/local/bin/svix-bridge' returned a non-zero code: 1
```

This should help to catch other dependency-related problems that will
show up at runtime.
@svix-james
Copy link
Contributor

😎

@svix-onelson svix-onelson merged commit 33cc8f0 into main Nov 12, 2024
4 checks passed
@svix-onelson svix-onelson deleted the onelson/bridge-docker-build branch November 12, 2024 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants