Hi @quartje ! When working on that ticket to remove gcc and other build tools from the images, we discussed the possibility of using plain Debian as a base for the php + apache images as well (like we do with the plain Apache2 images), as opposed to the official PHP image.
I have opened this branch and PR with an example Dockerfile in each of the php-apache images that uses Debian as a base. The files are called Dockerfile.debian. You will see that they are not as different as you would expect. The big difference is that Debian comes by default with PHP 7.4. We need PHP 7.2 and 8.2 The semi-official - and recommended by Debian - way to install various other versions of PHP is by using the Sury repository: https://deb.sury.org/. Adding this repo to the OS not only allows us to install various versions of PHP but also install them in parallel if we ever need to.
I have successfully used this repo in a lot of other projects, never ran into issues and especially security issues. I will leave it to you to evaluate if you want to use it. My recommendation would be to switch to this:
much easier to install and manage packages.
a consistent way of installing packages: no more using custom scripts and Pecl at the same time. And consistent with the other base images
no more build tools (gcc, gd) installed in the image
have tested this and resulting image is much smaller: ~350 mb as opposed to ~650 mb like it is now
you can install xdebug simply by running apt-get install php7.2-xdebug, no need to involve pecl in the mix
Hi @quartje ! When working on that ticket to remove gcc and other build tools from the images, we discussed the possibility of using plain Debian as a base for the php + apache images as well (like we do with the plain Apache2 images), as opposed to the official PHP image.
I have opened this branch and PR with an example Dockerfile in each of the php-apache images that uses Debian as a base. The files are called
Dockerfile.debian
. You will see that they are not as different as you would expect. The big difference is that Debian comes by default with PHP 7.4. We need PHP 7.2 and 8.2 The semi-official - and recommended by Debian - way to install various other versions of PHP is by using the Sury repository: https://deb.sury.org/. Adding this repo to the OS not only allows us to install various versions of PHP but also install them in parallel if we ever need to.I have successfully used this repo in a lot of other projects, never ran into issues and especially security issues. I will leave it to you to evaluate if you want to use it. My recommendation would be to switch to this:
apt-get install php7.2-xdebug
, no need to involve pecl in the mix