Skip to content

Strip build-only tooling from the finished image#180

Open
eiriksm wants to merge 4 commits into
mainfrom
claude/build-tools-cleanup-xmpagv
Open

Strip build-only tooling from the finished image#180
eiriksm wants to merge 4 commits into
mainfrom
claude/build-tools-cleanup-xmpagv

Conversation

@eiriksm

@eiriksm eiriksm commented Jul 7, 2026

Copy link
Copy Markdown
Member

No description provided.

claude and others added 3 commits July 7, 2026 19:21
Split apk installs into a runtime set (CLI tools + libs kept explicit)
and a virtual .build-deps group holding compilers, headers and -dev
packages needed only to compile the PHP extensions. After all
extensions are built, scan the compiled .so files with scanelf to
detect the shared libraries they actually link against, install those
explicitly, then delete .build-deps. Also run docker-php-source delete
to drop the extracted PHP source tree, and dedupe a couple of packages
that were listed twice. This follows the same pattern the official PHP
Docker images use to keep gcc/make/*-dev packages and the PHP source
tree out of the final image.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HSR8gEQwdQK7LfdNsDRfk
apk add --virtual NAME replaces an existing virtual package's
dependency list rather than merging into it. Reusing .build-deps for
the mid-script oniguruma-dev/krb5-dev installs redefined it down to
just that one package, immediately purging everything from the
original .build-deps set (including zlib-dev, pulled in transitively)
before gd's configure step needed it - which is why the PHP 8.6 build
failed with "Package 'zlib' not found". Install those two as plain
packages instead, same as before this cleanup.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013HSR8gEQwdQK7LfdNsDRfk
@eiriksm eiriksm enabled auto-merge (squash) July 8, 2026 07:08
@eiriksm eiriksm disabled auto-merge July 8, 2026 10:06
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