Skip to content

docker-php-ext-install ${PHP_EXTENTIONS} && docker-php-ext-enable ${PHP_EXTENTIONS}' returned a non-zero code: 1 #1059

@hAh0L13

Description

@hAh0L13

I'm using php:7.1-fpm-alpine image in my Dockerfile. After docker-php-ext-install ${PHP_EXTENTIONS} && docker-php-ext-enable ${PHP_EXTENTIONS}' command I receive error:

Build complete.
Don't forget to run 'make test'.
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20160303/
find . -name \*.gcno -o -name \*.gcda | xargs rm -f
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
find . -name .libs -a -type d|xargs rm -rf
rm -f libphp.la       modules/* libs/*
(1/1) Purging .phpize-deps (20200928.060725)
OK: 316 MiB in 125 packages
rm: can't remove '/usr/src/php/Zend/tests/return_types': Directory not empty
rm: can't remove '/usr/src/php/ext/opcache': Directory not empty
rm: can't remove '/usr/src/php/ext/mysqlnd': Directory not empty
rm: can't remove '/usr/src/php/ext/gd/libgd': Directory not empty
rm: can't remove '/usr/src/php/ext/hash/tests': Directory not empty
rm: can't remove '/usr/src/php/ext/intl': Directory not empty
rm: can't remove '/usr/src/php/ext/soap/tests/soap12': Directory not empty
rm: can't remove '/usr/src/php/ext/soap/tests/interop/Round3/GroupD': Directory not empty
rm: can't remove '/usr/src/php/ext/phar/tests/zip': Directory not empty
rm: can't remove '/usr/src/php/ext/phar/tests/tar/files': Directory not empty
rm: can't remove '/usr/src/php/ext/phar/tests/cache_list/files': Directory not empty
rm: can't remove '/usr/src/php/ext/standard/tests/url': Directory not empty

This is part of my Dockerfile to illustrate process:
Dockerfile_part.txt

Dockerfile
FROM php:7.1-fpm-alpine as base

RUN  apk --no-cache update

FROM base as build

ENV PHP_EXTENTIONS="intl opcache bcmath sockets zip" \
    PECL_EXTENTIONS="apcu timezonedb uuid" \
    IGBINARY_VERSION=master \
    MEMCACHED_VERSION=php7 \
    REDIS_VERSION=3.0.0 \
    GEOIP_VERSION=1.1.1

RUN pear config-set http_proxy <proxy_dns>:8080

RUN set -xe \
  && PECL_EXCLUDE_REGEX='igbinary|memcached|redis|geoip' \
  && PECL_EXTENTIONS="$(echo ${PECL_EXTENTIONS} | tr ' ' '\n' | egrep -v ${PECL_EXCLUDE_REGEX} | xargs echo)" \
  && NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1)

RUN apk add libbz2 \
        libmemcached \
        icu-libs \
        geoip \
        tzdata \
        libuuid \
        libpng \
        libjpeg-turbo \
        zlib \
        freetype \
        libxslt \
        libmcrypt \
        libwebp-dev \
        libpng-dev \
        libjpeg-turbo-dev \
        zlib-dev \
        freetype-dev \
        libxpm-dev \
        libpng-dev \
        rsync \
        git \
        gmp-dev \
        gmp \
        ca-certificates

RUN apk add --virtual .build-deps \
        $PHPIZE_DEPS \
        util-linux-dev \
        libxml2-dev \
        pcre-dev \
        libxslt-dev \
        bzip2-dev \
        icu-dev \
        libmcrypt-dev \
        libmemcached-dev \
        cyrus-sasl-dev \
        geoip-dev

RUN docker-php-ext-install ${PHP_EXTENTIONS}  &&  docker-php-ext-enable ${PHP_EXTENTIONS}

How can I fix this errors?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionUsability question, not directly related to an error with the image

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions