I'm trying to build a php image with this Dockerfile:
FROM php:8.0-fpm-alpine
RUN docker-php-ext-install pdo pdo_mysql
It works fine on pc (amd64), but on a Raspberry Pi B+ (armv6) it gets stuck as soon as it reach the command, I can still type in the terminal, so it's not frozen, it just doesn't proceed.
I've also tried php:8.0-fpm and arm32v6/php:7.4-fpm-alpine to no avail.
Any clues?
The issue appears to be the package manager not working for users of x86, armv7, and armhf due to some outdated packages as stated here (Alpine >= 3.13) and here (Debian >= bullseye).
The docker-php-ext-install script tries to use the package manager, which fails, but errors are not displayed making the issue unclear at first.
To solve this you can either run an image of php that uses Alpine < 3.13 / Debian < bullseye e.g. php:7.0-fpm-alpine (Alpine 3.7) / php:8.0-fpm-buster (Debian Buster), or use one of the fix in the links above (run the container with --privileged or manually update libseccomp).