From a7acd52671e22c9d16979f25e8fad7e4052d017a Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Tue, 22 Mar 2022 00:31:49 +0800 Subject: [PATCH 1/3] feat: slim down php-fpm-8.1 --- images/php-fpm/8.1.Dockerfile | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/images/php-fpm/8.1.Dockerfile b/images/php-fpm/8.1.Dockerfile index 71c611f82..5258fa307 100644 --- a/images/php-fpm/8.1.Dockerfile +++ b/images/php-fpm/8.1.Dockerfile @@ -44,9 +44,8 @@ COPY php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf COPY ssmtp.conf /etc/ssmtp/ssmtp.conf COPY blackfire.ini /usr/local/etc/php/conf.d/blackfire.disable -RUN apk add --no-cache fcgi \ - ssmtp \ - libzip libzip-dev \ +RUN apk add --no-cache --virtual .devdeps \ + libzip-dev \ # for gd libpng-dev \ libjpeg-turbo-dev \ @@ -65,23 +64,37 @@ RUN apk add --no-cache fcgi \ # for yaml yaml-dev \ # for imagemagick + imagemagick-dev \ + && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ + && yes '' | pecl install -f apcu-5.1.21 \ + && yes '' | pecl install -f imagick-3.7.0 \ + && yes '' | pecl install -f redis-5.3.7 \ + && yes '' | pecl install -f xdebug-3.1.3 \ + && yes '' | pecl install -f yaml-2.2.2 \ + && docker-php-ext-enable apcu imagick redis xdebug yaml \ + && rm -rf /tmp/pear \ + && apk del -r .phpize-deps \ + && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && docker-php-ext-configure gd --with-webp --with-jpeg \ + && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip \ + && apk del -r .devdeps \ + && apk add --no-cache \ + fcgi \ + ssmtp \ + libzip \ + libpng \ + libjpeg-turbo \ + gettext \ + libmcrypt \ + libxml2 \ + libxslt \ + libgcrypt \ + libwebp \ + postgresql-libs \ + yaml \ imagemagick \ - imagemagick-libs \ - imagemagick-dev - -RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ - && yes '' | pecl install -f apcu-5.1.21 \ - && yes '' | pecl install -f imagick-3.7.0 \ - && yes '' | pecl install -f redis-5.3.7 \ - && yes '' | pecl install -f xdebug-3.1.3 \ - && yes '' | pecl install -f yaml-2.2.2 \ - && docker-php-ext-enable apcu imagick redis xdebug yaml \ - && rm -rf /var/cache/apk/* /tmp/pear/ \ - && apk del .phpize-deps \ - && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - -RUN docker-php-ext-configure gd --with-webp --with-jpeg \ - && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip + imagemagick-libs + # New Relic PHP Agent. # @see https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/ From 52d6e749df635c73b159d949a176daeb69f5ac04 Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Tue, 22 Mar 2022 10:32:16 +0800 Subject: [PATCH 2/3] feat: slim down php-fpm-8.0 --- images/php-fpm/8.0.Dockerfile | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/images/php-fpm/8.0.Dockerfile b/images/php-fpm/8.0.Dockerfile index 0b75fa165..c1f5a01a0 100644 --- a/images/php-fpm/8.0.Dockerfile +++ b/images/php-fpm/8.0.Dockerfile @@ -44,9 +44,8 @@ COPY php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf COPY ssmtp.conf /etc/ssmtp/ssmtp.conf COPY blackfire.ini /usr/local/etc/php/conf.d/blackfire.disable -RUN apk add --no-cache fcgi \ - ssmtp \ - libzip libzip-dev \ +RUN apk add --no-cache --virtual .devdeps \ + libzip-dev \ # for gd libpng-dev \ libjpeg-turbo-dev \ @@ -65,23 +64,37 @@ RUN apk add --no-cache fcgi \ # for yaml yaml-dev \ # for imagemagick + imagemagick-dev \ + && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ + && yes '' | pecl install -f apcu-5.1.21 \ + && yes '' | pecl install -f imagick-3.7.0 \ + && yes '' | pecl install -f redis-5.3.7 \ + && yes '' | pecl install -f xdebug-3.1.3 \ + && yes '' | pecl install -f yaml-2.2.2 \ + && docker-php-ext-enable apcu imagick redis xdebug yaml \ + && rm -rf /tmp/pear \ + && apk del -r .phpize-deps \ + && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && docker-php-ext-configure gd --with-webp --with-jpeg \ + && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip \ + && apk del -r .devdeps \ + && apk add --no-cache \ + fcgi \ + ssmtp \ + libzip \ + libpng \ + libjpeg-turbo \ + gettext \ + libmcrypt \ + libxml2 \ + libxslt \ + libgcrypt \ + libwebp \ + postgresql-libs \ + yaml \ imagemagick \ - imagemagick-libs \ - imagemagick-dev - -RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ - && yes '' | pecl install -f apcu-5.1.21 \ - && yes '' | pecl install -f imagick-3.7.0 \ - && yes '' | pecl install -f redis-5.3.7 \ - && yes '' | pecl install -f xdebug-3.1.3 \ - && yes '' | pecl install -f yaml-2.2.2 \ - && docker-php-ext-enable apcu imagick redis xdebug yaml \ - && rm -rf /var/cache/apk/* /tmp/pear/ \ - && apk del .phpize-deps \ - && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - -RUN docker-php-ext-configure gd --with-webp --with-jpeg \ - && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip + imagemagick-libs + # New Relic PHP Agent. # @see https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/ From 298cb15a3aad1597d100a3b9de479495f68b9fdb Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Tue, 22 Mar 2022 13:10:39 +0800 Subject: [PATCH 3/3] feat: slim down php-7.4-fpm --- images/php-fpm/7.4.Dockerfile | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/images/php-fpm/7.4.Dockerfile b/images/php-fpm/7.4.Dockerfile index 47fbc8d9c..010eaa9dd 100644 --- a/images/php-fpm/7.4.Dockerfile +++ b/images/php-fpm/7.4.Dockerfile @@ -44,9 +44,8 @@ COPY php-fpm.d/www.conf /usr/local/etc/php-fpm.d/www.conf COPY ssmtp.conf /etc/ssmtp/ssmtp.conf COPY blackfire.ini /usr/local/etc/php/conf.d/blackfire.disable -RUN apk add --no-cache fcgi \ - ssmtp \ - libzip libzip-dev \ +RUN apk add --no-cache --virtual .devdeps \ + libzip-dev \ # for gd libpng-dev \ libjpeg-turbo-dev \ @@ -65,23 +64,37 @@ RUN apk add --no-cache fcgi \ # for yaml yaml-dev \ # for imagemagick + imagemagick-dev \ + && apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ + && yes '' | pecl install -f apcu-5.1.21 \ + && yes '' | pecl install -f imagick-3.7.0 \ + && yes '' | pecl install -f redis-4.3.0 \ + && yes '' | pecl install -f xdebug-3.1.3 \ + && yes '' | pecl install -f yaml-2.2.2 \ + && docker-php-ext-enable apcu imagick redis xdebug yaml \ + && rm -rf /tmp/pear \ + && apk del -r .phpize-deps \ + && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && docker-php-ext-configure gd --with-webp --with-jpeg \ + && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip \ + && apk del -r .devdeps \ + && apk add --no-cache \ + fcgi \ + ssmtp \ + libzip \ + libpng \ + libjpeg-turbo \ + gettext \ + libmcrypt \ + libxml2 \ + libxslt \ + libgcrypt \ + libwebp \ + postgresql-libs \ + yaml \ imagemagick \ - imagemagick-libs \ - imagemagick-dev - -RUN apk add --no-cache --virtual .phpize-deps $PHPIZE_DEPS \ - && yes '' | pecl install -f apcu-5.1.21 \ - && yes '' | pecl install -f imagick-3.7.0 \ - && yes '' | pecl install -f redis-4.3.0 \ - && yes '' | pecl install -f xdebug-3.1.3 \ - && yes '' | pecl install -f yaml-2.2.2 \ - && docker-php-ext-enable apcu imagick redis xdebug yaml \ - && rm -rf /var/cache/apk/* /tmp/pear/ \ - && apk del .phpize-deps \ - && sed -i '1s/^/;Intentionally disabled. Enable via setting env variable XDEBUG_ENABLE to true\n;/' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini - -RUN docker-php-ext-configure gd --with-webp --with-jpeg \ - && docker-php-ext-install -j4 bcmath gd gettext mysqli pdo_mysql opcache pdo_pgsql pgsql shmop soap sockets xsl zip + imagemagick-libs + # New Relic PHP Agent. # @see https://docs.newrelic.com/docs/release-notes/agent-release-notes/php-release-notes/