Skip to content

Optionally remove build-only dependencies and bloat after install #618

@peaklabs-dev

Description

@peaklabs-dev

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 .so files to reduce size even more.

Flag naming ideas

pie install xdebug/xdebug \
  --cleanup \
  --strip-debug-symbols \

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions