Skip to content

Remove build dependencies after docker-php-ext-install #557

Closed

Description

@J0WI

Since removing build dependencies after installing PHP extensions (e.g. docker-library/wordpress#267) seems to be a common task it would make sense to have such a functionality in the docker-php-ext-* scripts.

Activity

  1. added
    RequestRequest for image modification or feature
    on Apr 25, 2018
  2. ebuildy commented on May 16, 2018

    @ebuildy

    /usr/src/php.tar.xz can be removed too ?

    docker run --rm php:7.2.5-cli-alpine3.7 ls -alh /usr/src => 11.5M (16% of the total image size)

  3. J0WI commented on May 16, 2018

    @J0WI
    ContributorAuthor

    Nope, that is used here.

  4. ebuildy commented on May 16, 2018

    @ebuildy

    yes, I mean, once we have installed the dependencies, we could remove it too (not use at run-time).

  5. yosifkit commented on Sep 12, 2018

    @yosifkit
    Member

    As for deleting the source, that would be a duplicate of #488.

    For auto-removing build dependencies that we add, that is done in the Alpine images:

    php/docker-php-ext-install

    Lines 116 to 118 in 4017680

    if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
    apk del $apkDel
    fi

    We don't auto-add build dependencies in Debian since any needed for phpize are already installed. See #513 (comment) and #438 for why we don't auto add/remove packages in Debian.

    As for any other dependencies that could be installed in a Dockerfile, since we didn't add them, we can't reasonably detect that they can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    RequestRequest for image modification or feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions