phpdocker-io / phpdocker.io

PHPDocker.io website and environment (php and docker based) generator

Home Page:http://phpdocker.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PHP 8.2 image does not include my specified optional components

realj42 opened this issue · comments

I am trying to create a PHP8.2 stack with a number of optional libraries but none of them are being included in the final build, crucially phpp8.2-mysql is missing. I have tried to rebuild multiple times but no luck , The contents of my Dockerfile are

FROM phpdockerio/php:8.2-fpm
WORKDIR "/application"

RUN apt-get update;
apt-get -y --no-install-recommends install
php8.2-bcmath \
php8.2-gd \
php8.2-gmagick \
php8.2-imagick \
php8.2-mysql \
php8.2-xdebug;
apt-get clean;
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

None of these install libraries are included - checked by running phpinfo.

OK just tried running the update command in the image teminal - get the following - looks like it cannot find those libraries in the repositories?

Get:1 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu jammy InRelease [23.9 kB]
Get:3 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB]
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [107 kB]
Get:6 http://ppa.launchpad.net/ondrej/php/ubuntu jammy/main amd64 Packages [187 kB]
Get:7 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [681 kB]
Get:8 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
Get:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
Get:10 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
Get:11 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
Get:12 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [799 kB]
Get:13 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [5557 B]
Get:14 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [754 kB]
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1008 kB]
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1083 kB]
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [8978 B]
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [734 kB]
Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [22.4 kB]
Get:20 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
Fetched 25.7 MB in 4s (7289 kB/s)
Reading package lists... Done
W: http://ppa.launchpad.net/ondrej/php/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package

/bin/sh: 4: php8.2-gd: not found

/bin/sh: 5: php8.2-gmagick: not found

/bin/sh: 6: php8.2-imagick: not found

/bin/sh: 7: php8.2-mysql: not found

Your second post is wrong, looks like you're trying to run php8.2-gd and all the others for instance directly on the shell.

After you update your Dockerfile, you need to

docker-compose build php-fpm
docker-compose down php-fpm
docker-compose up -d

It's on the README generated alongside the zip file.

Hi - I am afraid your fix does not work - the optional libraries are simply not getting installed, no matter how many times I try to build the image. For now I will switch to using the bitnami/php-fpm image as that does include all libraries as standard.