fix: isolate glibc libs in alpine image to avoid conflicts with musl packages#523
Merged
bartlomieju merged 2 commits intomainfrom Mar 25, 2026
Merged
fix: isolate glibc libs in alpine image to avoid conflicts with musl packages#523bartlomieju merged 2 commits intomainfrom
bartlomieju merged 2 commits intomainfrom
Conversation
…packages Move glibc libraries from /usr/local/lib/ to /usr/local/lib/glibc/ and use patchelf to embed the rpath directly in the deno and tini binaries, removing the global LD_LIBRARY_PATH env var. This prevents glibc's libgcc_s.so.1 from shadowing Alpine's musl-compatible version, which caused crashes when installing musl-based packages like node or ffmpeg. Fixes #350 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
/usr/local/lib/to/usr/local/lib/glibc/so they don't shadow Alpine's musl-compatible librariesLD_LIBRARY_PATH="/usr/local/lib"env varpatchelf --set-rpathto embed the library path directly in thedenoandtinibinaries (patchelf is installed and removed in the same layer)This fixes the issue where installing musl-based packages (node, ffmpeg, etc.) into the alpine image would crash because glibc's
libgcc_s.so.1in/usr/local/lib/was shadowing Alpine's native version.Before:
After:
Fixes #350
Test plan
deno eval "console.log('hello')"worksdeno --versionworksapk add nodejs npm && node -vworks (no longer crashes)npm:expressruns and responds correctly🤖 Generated with Claude Code