user11931805
user11931805

Reputation: 55

executor failed running /bin/sh -c docker-php-ext-install

I am trying upgrade this docker file from 7.3 to 7.4 but getting executor failed error.

Detailed error:

executor failed running [/bin/sh -c docker-php-ext-install bcmath
ctype dom gd hash iconv intl mbstring
mysqli opcache pdo_mysql simplexml sockets soap
sodium xsl zip ;]: exit code: 2

FROM php:7.4-fpm as base

ENV COMPOSER_HOME=/tmp/composer
ENV APCU_VERSION=5.1.18

RUN apt-get update && 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 "memory_limit=1G" >> /usr/local/etc/php/conf.d/zz-memory-limit-php.ini
RUN echo "apc.enable=1" >> /usr/local/etc/php/conf.d/zz-apcu.ini
RUN echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/zz-apcu.ini
RUN echo "opcache.memory_consumption=512MB" >> /usr/local/etc/php/conf.d/zz-opcache.conf
RUN echo "opcache.max_accelerated_files=60000" >> /usr/local/etc/php/conf.d/zz-opcache.conf
RUN echo "opcache.consistency_checks=0" >> /usr/local/etc/php/conf.d/zz-opcache.conf
RUN echo "opcache.validate_timestamps=0" >> /usr/local/etc/php/conf.d/zz-opcache.conf
RUN echo "opcache.enable_cli=1" >> /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 \
    && chmod 755 /usr/local/bin/magerun
RUN mkdir -p -m 0775 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
RUN mkdir -p -m 0775 ~/.ssh && ssh-keyscan github.com >> /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

Upvotes: 1

Views: 3191

Answers (1)

Nico H
Nico H

Reputation: 21

i had a similar issue today. Seems that in php7.4 iconv his a native library. So you should try to remove it from your Dockerfile and see if it works. Even if it's an 6 month old issue, i hope it could help someone. Chears.

Upvotes: 0

Related Questions