title: executor failed running /bin/sh -c docker-php-ext-install
body: <p>I am trying upgrade this docker file from 7.3 to 7.4 but getting executor failed error.</p>
  <p>Detailed error:</p>
  <blockquote>
  <p>executor failed running [/bin/sh -c docker-php-ext-install     bcmath<br />
  ctype     dom     gd     hash     iconv     intl     mbstring<br />
  mysqli     opcache     pdo_mysql     simplexml     sockets     soap<br />
  sodium     xsl     zip     ;]: exit code: 2</p>
  </blockquote>
  <pre><code>FROM php:7.4-fpm as base
  
  ENV COMPOSER_HOME=/tmp/composer
  ENV APCU_VERSION=5.1.18
  
  RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends gnupg \
      netcat \
      sudo \
      libicu-dev \
      libfreetype6-dev \
      libjpeg-dev \
      libpng-dev \
      libsodium-dev \
      libxml2-dev \
      libxslt-dev \
      libzip-dev \
      rsync \
      unzip \
      git \
      openssh-client \
      ;
  
  RUN pecl install apcu-${APCU_VERSION}
  
  RUN docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/
  RUN docker-php-ext-install \
      bcmath \
      ctype \
      dom \
      gd \
      hash \
      iconv \
      intl \
      mbstring \
      mysqli \
      opcache \
      pdo_mysql \
      simplexml \
      sockets \
      soap \
      sodium \
      xsl \
      zip \
      ;
  
  RUN docker-php-ext-enable apcu
  
  RUN echo &quot;memory_limit=1G&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-memory-limit-php.ini
  RUN echo &quot;apc.enable=1&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-apcu.ini
  RUN echo &quot;apc.enable_cli=1&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-apcu.ini
  RUN echo &quot;opcache.memory_consumption=512MB&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-opcache.conf
  RUN echo &quot;opcache.max_accelerated_files=60000&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-opcache.conf
  RUN echo &quot;opcache.consistency_checks=0&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-opcache.conf
  RUN echo &quot;opcache.validate_timestamps=0&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-opcache.conf
  RUN echo &quot;opcache.enable_cli=1&quot; &gt;&gt; /usr/local/etc/php/conf.d/zz-opcache.conf
  
  FROM base as build
  
  RUN curl https://files.magerun.net/n98-magerun2.phar -o /usr/local/bin/magerun \
      &amp;&amp; chmod 755 /usr/local/bin/magerun
  RUN mkdir -p -m 0775 ~/.ssh &amp;&amp; ssh-keyscan github.com &gt;&gt; ~/.ssh/known_hosts
  RUN mkdir -p -m 0775 ~/.ssh &amp;&amp; ssh-keyscan github.com &gt;&gt; /var/www/.ssh
  
  # USER www-data
  WORKDIR /var/www/html
  
  ARG COMPOSER_AUTH
  
  COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
  RUN composer global require hirak/prestissimo
  
  COPY auth.json auth.json
  COPY composer.json composer.json
  COPY composer.lock composer.lock
  
  RUN --mount=type=ssh,id=id_rsa php -d memory_limit=2G $(which composer) install --no-progress --no-dev
  
  COPY  app/etc/config.php app/etc/config.php
  
  COPY  bin bin
  
  FROM build as app
  
  ENV MAGE_MODE=production
  RUN php -d memory_limit=2G bin/magento setup:di:compile
  RUN composer dump-autoload --optimize --apcu
  RUN php -d memory_limit=2G bin/magento setup:static-content:deploy -f
  RUN rm -rf /var/www/html/var/cache
  RUN rm -rf /var/www/html/var/page_cache
  RUN rm -rf /var/www/html/var/session
  
  COPY --chown=www-data app/etc/env.docker.php app/etc/env.php
  </code></pre>