fix: musl link error with glibc libs in /usr/local/lib/ on alpine#499
Open
erusc wants to merge 1 commit intodenoland:mainfrom
Open
fix: musl link error with glibc libs in /usr/local/lib/ on alpine#499erusc wants to merge 1 commit intodenoland:mainfrom
erusc wants to merge 1 commit intodenoland:mainfrom
Conversation
Putting glibc libs in /usr/local/lib/ can result in link error when a musl binary tries to link libgcc. This fix it by putting them in the same path as in gcr.io/distroless/cc, which also eliminates the need for LD_LIBRARY_PATH.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When I tried to add ffmpeg to
denoland/deno:alpine. I got this link error.docker run --rm -it denoland/deno:alpine sh -c 'apk add ffmpeg && ffmpeg'I instigated and found that is was caused by glibc libs in /usr/local/lib/, copied from gcr.io/distroless/cc.
deno_docker/alpine.dockerfile
Line 22 in 58689c6
This PR fixes the issue by putting glibc libs in the same path as in gcr.io/distroless/cc.
ls /lib/$(arch)-linux-gnu/ /lib64/Since
/lib/x86_64-linux-gnu(/lib/aarch64-linux-gnuon arm64) is used exclusively by glibc dynamic linker, this eliminates the interference with musl and the need for environment variableLD_LIBRARY_PATH.