Error building php build

Hi.

We had some php builds in our private repository.
A few weeks ago the builds were successful, but now the builds fails with:

#9 ERROR: executor failed running [/bin/sh -c NPROC=$(getconf _NPROCESSORS_ONLN) && docker-php-ext-install -j${NPROC} iconv intl opcache pcntl pdo pdo_mysql pdo_sqlite readline session simplexml xml xsl zip gd && pecl install xdebug && docker-php-ext-enable xdebug && pecl install apcu && docker-php-ext-enable apcu && apk del .gd-build-deps && apk del .build-deps && apk del .ext-build-deps && rm -r /tmp/*]: exit code: 2
------
> [ 5/21] RUN NPROC=$(getconf _NPROCESSORS_ONLN) && docker-php-ext-install -j${NPROC} iconv intl opcache pcntl pdo pdo_mysql pdo_sqlite readline session simplexml xml xsl zip gd && pecl install xdebug && docker-php-ext-enable xdebug && pecl install apcu && docker-php-ext-enable apcu && apk del .gd-build-deps && apk del .build-deps && apk del .ext-build-deps && rm -r /tmp/*:
------
error: failed to solve: rpc error: code = Unknown desc = executor failed running [/bin/sh -c NPROC=$(getconf _NPROCESSORS_ONLN) && docker-php-ext-install -j${NPROC} iconv intl opcache pcntl pdo pdo_mysql pdo_sqlite readline session simplexml xml xsl zip gd && pecl install xdebug && docker-php-ext-enable xdebug && pecl install apcu && docker-php-ext-enable apcu && apk del .gd-build-deps && apk del .build-deps && apk del .ext-build-deps && rm -r /tmp/*]: exit code: 2
Build failed using Buildkit

The Dockerfile we use:

FROM php:8.0-fpm-alpine

# Install PHP extensions
RUN apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \
    apk add --no-cache --virtual .gd-runtime-deps freetype libpng libjpeg-turbo && \
    apk add --no-cache --virtual .gd-build-deps freetype-dev libpng-dev libjpeg-turbo-dev && \
    apk add --no-cache --virtual .ext-runtime-deps libbz2 libzip-dev libmcrypt libxslt icu && \
    apk add --no-cache --virtual .ext-build-deps bzip2-dev libmcrypt-dev libxml2-dev libedit-dev libxslt-dev icu-dev sqlite-dev

RUN docker-php-ext-configure gd \
      --with-freetype=/usr/include/ \
      --with-jpeg=/usr/include/

RUN NPROC=$(getconf _NPROCESSORS_ONLN) && \
    docker-php-ext-install -j${NPROC} bz2 dom exif fileinfo

RUN NPROC=$(getconf _NPROCESSORS_ONLN) && \
    docker-php-ext-install -j${NPROC} iconv intl opcache pcntl pdo pdo_mysql pdo_sqlite readline session simplexml xml xsl zip gd && \
    pecl install xdebug && \
    docker-php-ext-enable xdebug && \
    pecl install apcu && \
    docker-php-ext-enable apcu && \
    apk del .gd-build-deps && \
    apk del .build-deps && \
    apk del .ext-build-deps && \
    rm -r /tmp/*

# download composerin the latest stable release
RUN curl -o composer-installer.php https://getcomposer.org/installer && \
    php composer-installer.php --quiet --install-dir="/usr/local/bin" && \
    ln -s /usr/local/bin/composer.phar /usr/local/bin/composer && \
    rm composer-installer.php

# Install git+ssh (for composer install)
RUN apk add --no-cache git openssh-client rsync

# Install mysql client (for data-transfer operations)
RUN apk add --no-cache mysql-client

# Install timezone change utils
RUN apk add --no-cache tzdata

# Tools to change the uid on run
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories && \
    apk add --no-cache shadow su-exec

# Install and configure fcron
RUN groupadd -r -g 109 fcron && \
    useradd -u 109 -r fcron -g fcron && \
    apk add --no-cache --virtual .build-deps g++ make perl && \
    wget http://fcron.free.fr/archives/fcron-3.3.0.src.tar.gz && \
    tar xfz fcron-3.3.0.src.tar.gz  && \
    cd fcron-3.3.0  && \
    ./configure && \
    make && \
    make install && \
    apk del .build-deps && \
    rm -Rf fcron-3.3.0*z
ADD fcron.conf /usr/local/etc
ADD echomail /usr/local/bin
RUN chown root:fcron /usr/local/etc/fcron.conf && \
    chmod 644 /usr/local/etc/fcron.conf

# Default configuration for fpm
# Project-specific ini can be added with COPY ./php-ini-overrides.ini /usr/local/etc/php/conf.d/
COPY ./zz-fpm.conf /usr/local/etc/php-fpm.d/

# Base php ini
COPY ./docker-base.ini /usr/local/etc/php/conf.d/

# Disable xdebug by default and add a script to reactivate
# Just add a COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini.bak in your project
COPY xdebug.sh /
RUN mv /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini.bak

# Cache composer downloads in a volume
VOLUME /var/www/.composer

# Script to wait for db
COPY wait-for /usr/local/bin

COPY entrypoint-cron /usr/local/bin
COPY entrypoint-chuid /usr/local/bin
ENTRYPOINT ["entrypoint-chuid"]
CMD ["php-fpm"]

Locally it builds without errors, but on dockerhub we get this error since a few weeks.

Anyone knows why this happens?

Kind regards.

I am also facing same issue while using docker-php-ext-install readline in FROM php:8.1.3-apache

Error:
cc -I. -I/usr/src/php/ext/readline -I/usr/src/php/ext/readline/include -I/usr/src/php/ext/readline/main -I/usr/src/php/ext/readline -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -I/usr/include/editline -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -Wno-strict-prototypes -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/readline/readline.c -MMD -MF readline.dep -MT readline.lo -fPIC -DPIC -o .libs/readline.o
In file included from /usr/local/include/php/main/php.h:35,
from /usr/src/php/ext/readline/readline.c:23:
/usr/src/php/ext/readline/readline.c: In function ‘zif_readline_info’:
/usr/src/php/ext/readline/readline.c:160:38: error: ‘rl_mark’ undeclared (first use in this function)
160 | add_assoc_long(return_value,“mark”,rl_mark);
| ^~~~~~~
/usr/local/include/php/Zend/zend_API.h:509:90: note: in definition of macro ‘add_assoc_long’
509 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
| ^~~
/usr/src/php/ext/readline/readline.c:160:38: note: each undeclared identifier is reported only once for each function it appears in
160 | add_assoc_long(return_value,“mark”,rl_mark);
| ^~~~~~~
/usr/local/include/php/Zend/zend_API.h:509:90: note: in definition of macro ‘add_assoc_long’
509 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
| ^~~
/usr/src/php/ext/readline/readline.c:162:47: error: ‘rl_pending_input’ undeclared (first use in this function)
162 | add_assoc_long(return_value,“pending_input”,rl_pending_input);
| ^~~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:509:90: note: in definition of macro ‘add_assoc_long’
509 | #define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key), __n)
| ^~~
/usr/src/php/ext/readline/readline.c:169:60: error: ‘rl_completion_suppress_append’ undeclared (first use in this function)
169 | add_assoc_bool(return_value,“completion_suppress_append”,rl_completion_suppress_append);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/php/Zend/zend_API.h:511:90: note: in definition of macro ‘add_assoc_bool’
511 | #define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key), __b)
| ^~~
make: *** [Makefile:202: readline.lo] Error 1
The command ‘/bin/sh -c docker-php-ext-configure gd --with-jpeg=/usr/include/ --with-freetype=/usr/include/ && apt-get install libonig-dev && docker-php-ext-install mbstring exif xml dom mysqli curl calendar bz2 gettext shmop sockets opcache zip readline’ returned a non-zero code: 2
ERROR: Service ‘app’ failed to build : Build failed