Optionally remove build-only dependencies and bloat after install
Open
@asgrim is already working on this.
Since May 19, 2026.
enhancement
maintainer investigating
- Dominant language
- PHP
- Stars
- 2k
- Forks
- 73
- Avg merge
- 3h 37m
- Merged PRs (30d)
- 11
Description
I still like mlocati/docker-php-extension-installer but I think it would be beneficial if there was official pie functionality that would automatically remove all build dependencies after installing extensions and maybe also remove other bloat. Then, we could just use the official way via pie also in containers (not just locally for dev) and let it handle all extensions.
Things that should be cleaned up after install (could be more):
- Build-only OS packages. To simplify this on Alpine we could use virtual packages and on Debian use diffing over the package list / using
apt-mark+apt-get autoremove. - The downloaded and extracted extension source and build artifacts (composer caches, attestation artifacts, `vendor/,...)
- Package-manager metadata and caches (
/var/lib/apt/lists/*,/var/cache/apt/*,/var/cache/apk/*). - Optionally we could strip debug symbols from compiled
.sofiles to reduce size even more.
Flag naming ideas
pie install xdebug/xdebug \
--cleanup \
--strip-debug-symbols \
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.