Skip to content

Debian Stretch Apache 5.6 Dockerfile leaves unnecessary build-time dependencies in layer, bloating image #778

Description

@wyqydsyq

The Dockerfile installs a bunch of build-time dependencies, apparently for "phpize" and never removes them, this results in a 209MB layer:

<missing>           2 weeks ago         /bin/sh -c #(nop)  ENV PHP_INI_DIR=/usr/loca…   0B
<missing>           2 weeks ago         /bin/sh -c apt-get update && apt-get install…   209MB
<missing>           2 weeks ago         /bin/sh -c #(nop)  ENV PHPIZE_DEPS=autoconf …   0B

Which arguably provides little to no benefit to most users of this image, a lot of people don't use PECL extensions let alone phpize to install them and in our case, we're explicitly installing them with the PECL installer in our own image.

In the odd case someone does want to use phpize, there should be an alternative image with it enabled, instead of pointlessly bloating the base apache image.

For some reason, Docker Hub misreports the image as being 130MB:

5.6-apache 130 MB
Last update: 2 days ago

But in reality upon pulling it, you find it's actually a whopping 355MB:

php    5.6-apache          a62c5acfd6c5        2 days ago          355MB

I'm guessing a lot of this bloat is due to the completely unnecessary 209MB layer mentioned.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions