My docker-compose is failing with Cannot find config.m4 when trying to use FROM php:8.2-apache

i am updating a docker installation from php 7 to 8.2

I am now getting the error when running docker-compose up -d --build

Status: Downloaded newer image for php:8.2-apache
 ---> c23ae93fd864
Step 2/40 : RUN docker-php-ext-install pdo pdo_mysql
---> Running in 2aa521a2771a
Cannot find config.m4. 
Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module
 
ERROR: Service '$DOCKER_USER-service' failed to build : The command '/bin/sh -c 
docker-php-ext-install pdo pdo_mysql' returned a non-zero code: 1
COMPLETE

These are the first 3 lines of my Dockerfile

FROM php:8.2-apache

RUN docker-php-ext-install pdo pdo_mysql
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

php:8.2-apache works fine on my macos running docker. it is only failing on an umbutu server running docker

if i use php:8.0-apache on the umbutu docker it runs fine, but then my version of laravel requires at least php 8.1. ARG!!!

Any help would be greatly appreciated