How to fix missing php extensions problems in custom Docker image?
I resolved this by removing the drush and composer services from the docker-compose file and updating my Dockerfile for drupal as follows:

FROM drupal


RUN apt-get update -y &amp;&amp; apt-get install -y wget vim git mysql-client

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" &amp;&amp; \
    php composer-setup.php &amp;&amp; \
    mv composer.phar /usr/local/bin/composer &amp;&amp; \
    php -r "unlink('composer-setup.php');"

RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.4.2/drush.phar &amp;&amp; \
    chmod +x drush.phar &amp;&amp; \
    mv drush.phar /usr/local/bin/drush