Skip to content

fix: clean up patchelf dependencies in alpine image#530

Merged
bartlomieju merged 1 commit into
mainfrom
fix-alpine-image-size
Mar 27, 2026
Merged

fix: clean up patchelf dependencies in alpine image#530
bartlomieju merged 1 commit into
mainfrom
fix-alpine-image-size

Conversation

@bartlomieju

@bartlomieju bartlomieju commented Mar 27, 2026

Copy link
Copy Markdown
Member
  • Use apk add --virtual .build-deps so that apk del .build-deps removes patchelf and its transitive dependencies (libgcc, libstdc++)
  • These were previously left behind after apk del patchelf, bloating the alpine image beyond the debian image size

Regression introduced in #523.

Running patchelf on /bin/deno in the final image created a duplicate
113MB layer (the full modified binary). Move patchelf to a separate
build stage so only the already-patched binary is COPYed into the
final image, eliminating the duplicate layer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bartlomieju bartlomieju force-pushed the fix-alpine-image-size branch from 84b3737 to cdb0ffb Compare March 27, 2026 07:17
@bartlomieju bartlomieju merged commit 58dc08c into main Mar 27, 2026
6 checks passed
@bartlomieju bartlomieju deleted the fix-alpine-image-size branch March 27, 2026 07:35
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.

1 participant