thecodingmachine / docker-images-php

A set of PHP Docker images
MIT License
792 stars 140 forks source link

slim-fpm with extensions cannot build anymore #355

Closed iquito closed 1 year ago

iquito commented 1 year ago

With the release of PHP 8.2.2 and using Docker 23.0.0 I cannot build the slim-fpm image anymore. This is the output when running docker build - < Dockerfile.txt with this very simple Dockerfile:

ARG PHP_EXTENSIONS="mysqli pdo_mysql intl gd bcmath"

FROM thecodingmachine/php:8.2-v4-slim-fpm
[+] Building 29.8s (5/7)                                                                                                                     
 => [internal] load build definition from Dockerfile                                                                                    0.1s
 => => transferring dockerfile: 132B                                                                                                    0.0s 
 => [internal] load .dockerignore                                                                                                       0.1s 
 => => transferring context: 2B                                                                                                         0.0s 
 => [internal] load metadata for docker.io/thecodingmachine/php:8.2-v4-slim-fpm                                                         0.0s 
 => CACHED [1/1] FROM docker.io/thecodingmachine/php:8.2-v4-slim-fpm                                                                    0.0s 
 => ERROR [2/1] RUN sudo -E PHP_EXTENSIONS="mysqli pdo_mysql intl gd bcmath" /usr/local/bin/install_selected_extensions.sh             29.7s
------                                                                                                                                       
 > [2/1] RUN sudo -E PHP_EXTENSIONS="mysqli pdo_mysql intl gd bcmath" /usr/local/bin/install_selected_extensions.sh:                         
#0 0.297 + mv /etc/apt/apt.conf.d/docker-clean /tmp/docker-clean                                                                             
#0 0.305 + apt-get update                                                                                                                    
#0 0.902 Get:1 http://archive.ubuntu.com/ubuntu focal InRelease [265 kB]                                                                     
#0 0.915 Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]                                                           
#0 0.915 Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu focal InRelease [23.9 kB]
#0 1.534 Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 Packages [193 kB]
#0 1.813 Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [2448 kB]
#0 1.997 Get:6 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
#0 2.262 Get:7 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
#0 2.528 Get:8 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [177 kB]
#0 2.666 Get:9 http://archive.ubuntu.com/ubuntu focal/restricted amd64 Packages [33.4 kB]
#0 2.683 Get:10 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [11.3 MB]
#0 2.938 Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [991 kB]
#0 3.038 Get:12 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [27.7 kB]
#0 3.041 Get:13 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [1882 kB]
#0 4.501 Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages [1275 kB]
#0 4.665 Get:15 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [31.2 kB]
#0 4.667 Get:16 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2921 kB]
#0 5.026 Get:17 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [1291 kB]
#0 5.197 Get:18 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [2009 kB]
#0 5.450 Get:19 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [28.6 kB]
#0 5.452 Get:20 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 Packages [55.2 kB]
#0 5.535 Fetched 25.3 MB in 5s (4856 kB/s)
#0 5.535 Reading package lists...
#0 6.139 + /usr/bin/real_php /usr/local/bin/install_selected_extensions.php
#0 6.150 *** Installing extensions ***
#0 6.152 + '[' -n '' ']'
#0 6.152 + '[' -n '' ']'
#0 6.152 + '[' -n '' ']'
#0 6.152 + '[' -n mysqlnd ']'
#0 6.152 + set +e
#0 6.152 + PACKAGE_NAME=mysql
#0 6.153 + apt-cache search --names-only php8.2-mysql
#0 6.153 + grep php8.2-mysql
#0 6.220 php8.2-mysql - MySQL module for PHP
#0 6.220 + set -e
#0 6.220 + apt-get install -y --no-install-recommends php8.2-mysql
#0 6.245 Reading package lists...
#0 6.256 Building dependency tree...
#0 6.380 Reading state information...
#0 6.528 The following additional packages will be installed:
#0 6.528   php8.2-cli php8.2-common php8.2-curl php8.2-fpm php8.2-mbstring
#0 6.528   php8.2-opcache php8.2-readline php8.2-xml php8.2-zip
#0 6.529 Suggested packages:
#0 6.529   php-pear
#0 6.547 The following NEW packages will be installed:
#0 6.547   php8.2-mysql
#0 6.548 The following packages will be upgraded:
#0 6.548   php8.2-cli php8.2-common php8.2-curl php8.2-fpm php8.2-mbstring
#0 6.549   php8.2-opcache php8.2-readline php8.2-xml php8.2-zip
#0 6.942 9 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
#0 6.942 Need to get 5161 kB of archives.
#0 6.942 After this operation, 467 kB of additional disk space will be used.
#0 6.942 Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-zip amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [26.4 kB]
#0 7.517 Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-xml amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [106 kB]
#0 8.474 Get:3 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-readline amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [12.8 kB]
#0 8.856 Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-opcache amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [336 kB]
#0 10.02 Get:5 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-mbstring amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [437 kB]
#0 11.35 Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-fpm amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [1717 kB]
#0 12.91 Get:7 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-curl amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [34.5 kB]
#0 13.48 Get:8 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-cli amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [1709 kB]
#0 15.05 Get:9 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-common amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [665 kB]
#0 16.40 Get:10 http://ppa.launchpad.net/ondrej/php/ubuntu focal/main amd64 php8.2-mysql amd64 8.2.2-1+ubuntu20.04.1+deb.sury.org+1 [117 kB]
#0 17.06 debconf: delaying package configuration, since apt-utils is not installed
#0 17.10 Fetched 5161 kB in 10s (495 kB/s)
(Reading database ... 11242 files and directories currently installed.)
#0 17.18 Preparing to unpack .../0-php8.2-zip_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 17.25 Unpacking php8.2-zip (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 17.42 Preparing to unpack .../1-php8.2-xml_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 17.70 Unpacking php8.2-xml (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 17.96 Preparing to unpack .../2-php8.2-readline_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 18.06 Unpacking php8.2-readline (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 18.23 Preparing to unpack .../3-php8.2-opcache_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 18.33 Unpacking php8.2-opcache (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 18.52 Preparing to unpack .../4-php8.2-mbstring_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 18.63 Unpacking php8.2-mbstring (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 18.85 Preparing to unpack .../5-php8.2-fpm_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 18.91 Unpacking php8.2-fpm (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 19.25 Preparing to unpack .../6-php8.2-curl_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 19.36 Unpacking php8.2-curl (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 19.52 Preparing to unpack .../7-php8.2-cli_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 19.57 Unpacking php8.2-cli (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 19.87 Preparing to unpack .../8-php8.2-common_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 20.59 Unpacking php8.2-common (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) over (8.2.1-2+ubuntu20.04.1+deb.sury.org+1) ...
#0 21.11 Selecting previously unselected package php8.2-mysql.
#0 21.11 Preparing to unpack .../9-php8.2-mysql_8.2.2-1+ubuntu20.04.1+deb.sury.org+1_amd64.deb ...
#0 21.13 Unpacking php8.2-mysql (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 21.25 Setting up php8.2-common (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 22.25 WARNING: Not enabling the ffi module for PHP 8.2 cli SAPI since the module
#0 22.25 WARNING: was disabled by local administrator.
#0 22.26 php_invoke ffi: no action - module was disabled by maintainer for PHP 8.2 cli sapi
#0 24.75 Setting up php8.2-mysql (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 24.87 
#0 24.87 Creating config file /etc/php/8.2/mods-available/mysqlnd.ini with new version
#0 25.12 
#0 25.12 Creating config file /etc/php/8.2/mods-available/mysqli.ini with new version
#0 25.37 
#0 25.37 Creating config file /etc/php/8.2/mods-available/pdo_mysql.ini with new version
#0 25.56 Setting up php8.2-zip (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 25.82 Setting up php8.2-opcache (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 26.08 Setting up php8.2-readline (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 26.34 Setting up php8.2-mbstring (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 26.56 Setting up php8.2-curl (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 26.82 Setting up php8.2-xml (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 28.13 Setting up php8.2-cli (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 28.17 update-alternatives: warning: forcing reinstallation of alternative /usr/bin/php8.2 because link group php is broken
#0 28.17 update-alternatives: warning: not replacing /usr/bin/php with a link
#0 28.17 update-alternatives: warning: skip creation of /usr/share/man/man1/php.1.gz because associated file /usr/share/man/man1/php8.2.1.gz (of link group php) doesn't exist
#0 28.28 Not replacing deleted config file /etc/php/8.2/cli/php.ini
#0 28.43 php_invoke ffi: no action - module was disabled by maintainer for PHP 8.2 cli sapi
#0 29.26 Setting up php8.2-fpm (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 29.33 
#0 29.33 Configuration file '/etc/php/8.2/fpm/pool.d/www.conf'
#0 29.33  ==> Modified (by you or by a script) since installation.
#0 29.33  ==> Package distributor has shipped an updated version.
#0 29.33    What would you like to do about it ?  Your options are:
#0 29.33     Y or I  : install the package maintainer's version
#0 29.33     N or O  : keep your currently-installed version
#0 29.33       D     : show the differences between the versions
#0 29.33       Z     : start a shell to examine the situation
#0 29.33  The default action is to keep your current version.
#0 29.33 *** www.conf (Y/I/N/O/D/Z) [default=N] ? dpkg: error processing package php8.2-fpm (--configure):
#0 29.33  end of file on stdin at conffile prompt
#0 29.33 Processing triggers for systemd (245.4-4ubuntu3.19) ...
#0 29.36 Processing triggers for php8.2-cli (8.2.2-1+ubuntu20.04.1+deb.sury.org+1) ...
#0 29.41 Errors were encountered while processing:
#0 29.41  php8.2-fpm
#0 29.51 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
Dockerfile:1
--------------------
   1 | >>> ARG PHP_EXTENSIONS="mysqli pdo_mysql intl gd bcmath"
   2 |     
   3 |     FROM thecodingmachine/php:8.2-v4-slim-fpm
--------------------
ERROR: failed to solve: process "/bin/bash -o pipefail -c sudo -E PHP_EXTENSIONS=\"$PHP_EXTENSIONS\" /usr/local/bin/install_selected_extensions.sh" did not complete successfully: exit code: 100

The image seems to upgrade some 8.2.1 packages to 8.2.2 and fails on the already existing www.conf. I am not sure why this is happening now (never had this problem previously), and if this has something to do with the new Docker version or just the new PHP version, or both.

iquito commented 1 year ago

The same happens with the PHP 8.1 slim-fpm image. It seems the base images are not updated (yet) and then installing an extension leads to an unintentional upgrade of the base packages, leading to the error.

iquito commented 1 year ago

Today the base images were updated and available with the new PHP version, which lead to the slim images building again (as installing the extensions does not lead to an unintentional upgrade of PHP anymore).

Yet I think it would be important that for new releases this build error would not occur - this time the image building failed for 2 days, ideally it would build successfully with the old PHP version until the image supports the new version no matter what extensions are added, especially as each month there is a new PHP version potentially leading to this error again.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.

stale[bot] commented 1 year ago

This issue has been automatically closed because it has not had recent activity. Please, reopen if you need.