Search code examples
phpdockerdockerfilealpine-linuxdocker-image

PHP-FPM Alpine Docker Image 7.4 installs PHP version 8.0


since the latest php fpm docker image update yesterday (https://hub.docker.com/_/php?tab=tags&page=1&name=fpm-alpine) my pipeline is broken because apparently PHP version 8 is installed instead of 7.4 as in my Dockerfile specified.

I am using this in my docker file:

FROM php:7.4-fpm-alpine AS ...

But according to my composer installs the container has PHP 8.0.13 running:

 Root composer.json requires php 7.4.26 but your php version (8.0.13) does not satisfy that requirement.

Anyone an idea what is going on here?


Solution

  • As Jeremy Brooks already mentioned, Alpine released version 3.15 where composer requires PHP 8 (https://pkgs.alpinelinux.org/package/v3.15/community/x86_64/composer). Instead of installing composer from getcomposer.org another solution is to use Alpine 3.14:

    FROM php:7.4-fpm-alpine3.14 AS ...