File tree Expand file tree Collapse file tree 4 files changed +33
-13
lines changed
Expand file tree Collapse file tree 4 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ RUN set -ex; \
6464 ; \
6565 # install imagick
6666 # https://pecl.php.net/package/imagick
67- pecl install imagick-3.8.0; \
68- docker-php-ext-enable imagick; \
69- rm -r /tmp/pear; \
67+ # fetch from GitHub repository until a new PECL version with PHP 8.5 support is available
68+ mkdir -p /usr/src/php/ext/imagick; \
69+ curl -fsSL https://github.com/Imagick/imagick/archive/45adfb7b1e322eaa6174e88f7d5e27ef20e0596e.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
70+ docker-php-ext-install imagick; \
71+ # pecl install imagick-3.8.0; \
72+ # docker-php-ext-enable imagick; \
73+ # rm -r /tmp/pear; \
7074 \
7175 # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
7276 # see https://github.com/docker-library/wordpress/blob/master/Dockerfile.template
@@ -86,10 +90,9 @@ RUN set -ex; \
8690# install composer
8791COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
8892
89- # enable OPcache
93+ # enable OPcache (PHP < 8.5) and use recommended settings
9094# see https://secure.php.net/manual/en/opcache.installation.php
9195RUN set -eux; \
92- docker-php-ext-enable opcache; \
9396 { \
9497 echo 'opcache.memory_consumption=128' ; \
9598 echo 'opcache.interned_strings_buffer=8' ; \
Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ RUN set -ex; \
6464 ; \
6565 # install imagick
6666 # https://pecl.php.net/package/imagick
67- pecl install imagick-3.8.0; \
68- docker-php-ext-enable imagick; \
69- rm -r /tmp/pear; \
67+ # fetch from GitHub repository until a new PECL version with PHP 8.5 support is available
68+ mkdir -p /usr/src/php/ext/imagick; \
69+ curl -fsSL https://github.com/Imagick/imagick/archive/45adfb7b1e322eaa6174e88f7d5e27ef20e0596e.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
70+ docker-php-ext-install imagick; \
71+ # pecl install imagick-3.8.0; \
72+ # docker-php-ext-enable imagick; \
73+ # rm -r /tmp/pear; \
7074 \
7175 # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
7276 # see https://github.com/docker-library/wordpress/blob/master/Dockerfile.template
@@ -86,10 +90,12 @@ RUN set -ex; \
8690# install composer
8791COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
8892
89- # enable OPcache
93+ # enable OPcache (PHP < 8.5) and use recommended settings
9094# see https://secure.php.net/manual/en/opcache.installation.php
9195RUN set -eux; \
96+ # enable opcache >>>
9297 docker-php-ext-enable opcache; \
98+ # <<< enable opcache
9399 { \
94100 echo 'opcache.memory_consumption=128' ; \
95101 echo 'opcache.interned_strings_buffer=8' ; \
Original file line number Diff line number Diff line change @@ -50,6 +50,11 @@ for (const image of images) {
5050 currentDockerfileSource = currentDockerfileSource . replaceAll ( key , replacements [ key ] ) ;
5151 } ) ;
5252
53+ // Remove to enable OPcache in PHP 8.5, because it is already enabled by default
54+ if ( [ '8.5' , '8.5-rc' ] . some ( el => String ( image [ "php-version" ] ) . includes ( el ) ) ) {
55+ currentDockerfileSource = currentDockerfileSource . replaceAll ( / ( ^ \s * ) ( # e n a b l e o p c a c h e > > > ) ( [ \s \S ] * ?) ( # < < < e n a b l e o p c a c h e ) ( \r ? \n ) / gm, '' ) ;
56+ }
57+
5358 Deno . writeTextFileSync ( `${ targetDir } /Dockerfile` , currentDockerfileSource ) ;
5459
5560 /**
Original file line number Diff line number Diff line change @@ -64,9 +64,13 @@ RUN set -ex; \
6464 ; \
6565 # install imagick
6666 # https://pecl.php.net/package/imagick
67- pecl install imagick-3.8.0; \
68- docker-php-ext-enable imagick; \
69- rm -r /tmp/pear; \
67+ # fetch from GitHub repository until a new PECL version with PHP 8.5 support is available
68+ mkdir -p /usr/src/php/ext/imagick; \
69+ curl -fsSL https://github.com/Imagick/imagick/archive/45adfb7b1e322eaa6174e88f7d5e27ef20e0596e.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
70+ docker-php-ext-install imagick; \
71+ # pecl install imagick-3.8.0; \
72+ # docker-php-ext-enable imagick; \
73+ # rm -r /tmp/pear; \
7074 \
7175 # reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
7276 # see https://github.com/docker-library/wordpress/blob/master/Dockerfile.template
@@ -86,10 +90,12 @@ RUN set -ex; \
8690# install composer
8791COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
8892
89- # enable OPcache
93+ # enable OPcache (PHP < 8.5) and use recommended settings
9094# see https://secure.php.net/manual/en/opcache.installation.php
9195RUN set -eux; \
96+ # enable opcache >>>
9297 docker-php-ext-enable opcache; \
98+ # <<< enable opcache
9399 { \
94100 echo 'opcache.memory_consumption=128' ; \
95101 echo 'opcache.interned_strings_buffer=8' ; \
You can’t perform that action at this time.
0 commit comments