Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php:7.4-fpm-alpine /bin/sh: Operation not permitted #1130

Closed
cmath10 opened this issue Feb 20, 2021 · 3 comments
Closed

php:7.4-fpm-alpine /bin/sh: Operation not permitted #1130

cmath10 opened this issue Feb 20, 2021 · 3 comments

Comments

@cmath10
Copy link

cmath10 commented Feb 20, 2021

Hello! Faced an issue while rebuilding my image:

creating libtool
appending configuration tag "CXX" to libtool
configure: patching config.h.in
configure: creating ./config.status
config.status: creating config.h
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultusermjFaAE/apcu-5.1.19/libtool --mode=compile cc -D_GNU_SOURCE -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/tmp/pear/temp/apcu -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultusermjFaAE/apcu-5.1.19/include -I/tmp/pear/temp/pear-build-defaultusermjFaAE/apcu-5.1.19/main -I/tmp/pear/temp/apcu -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/apcu/apc.c -o apc.lo
make: /bin/sh: Operation not permitted
make: *** [Makefile:194: apc.lo] Error 127
ERROR: `make' failed
ERROR: Service 'php' failed to build : The command '/bin/sh -c set -ex     && apk add --no-cache --virtual .build-deps         autoconf         bzip2-dev         curl-dev         file         freetype-dev         gcc         git         krb5-dev         krb5-conf         libc-dev         libpng-dev         make         oniguruma-dev         postgresql-dev         zlib-dev     && pecl install apcu igbinary xdebug     && docker-php-ext-enable apcu igbinary xdebug     && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini     && echo "xdebug.remote_connect_back=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini     && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini     && echo "xdebug.remote_mode=req" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini     && yes | pecl install redis     && docker-php-ext-enable redis     && docker-php-ext-configure gd        --with-freetype=/usr/include/        --with-jpeg=/usr/include/     && docker-php-ext-configure pgsql -with-pgsql=/usr/include/postgresql/     && docker-php-ext-install         bcmath         curl         gd         intl         json         mbstring         opcache         pcntl         pgsql         pdo         pdo_pgsql         soap         sockets         xsl         zip     && apk del --no-network .build-deps' returned a non-zero code: 1

This config worked for me previously (~nov-dec 2020) but broken down now:

Dockerfile
FROM php:7.4-fpm-alpine

# Locale
ENV LANG "C.UTF-8"
ENV LANGUAGE "C.UTF-8"
ENV LC_ALL "C.UTF-8"

# Dependencies
RUN set -ex \
    && apk update \
    && apk add --no-cache \
        bash \
        bash-completion \
        coreutils \
        freetype \
        icu-libs \
        libbz2 \
        libcurl \
        libjpeg-turbo-dev \
        libmcrypt-dev \
        libpng \
        libpq \
        libxml2 \
        libxpm-dev \
        libxslt-dev \
        libzip-dev \
        oniguruma \
        nano \
        unzip \
        util-linux \
        util-linux-bash-completion \
        wget \
        zlib \
        zstd-dev

# User utils
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories
RUN set -ex \
    && apk update \
    && apk add --no-cache \
        runuser \
        shadow

# Install PHP extensions
RUN set -ex \
    && apk add --no-cache --virtual .build-deps \
        autoconf \
        bzip2-dev \
        curl-dev \
        file \
        freetype-dev \
        gcc \
        git \
        krb5-dev \
        krb5-conf \
        libc-dev \
        libpng-dev \
        make \
        oniguruma-dev \
        postgresql-dev \
        zlib-dev \
    && pecl install apcu igbinary xdebug \
    && docker-php-ext-enable apcu igbinary xdebug \
    && echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_connect_back=off" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && echo "xdebug.remote_mode=req" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
    && yes | pecl install redis \
    && docker-php-ext-enable redis \
    && docker-php-ext-configure gd \
       --with-freetype=/usr/include/ \
       --with-jpeg=/usr/include/ \
    && docker-php-ext-configure pgsql -with-pgsql=/usr/include/postgresql/ \
    && docker-php-ext-install \
        bcmath \
        curl \
        gd \
        intl \
        json \
        mbstring \
        opcache \
        pcntl \
        pgsql \
        pdo \
        pdo_pgsql \
        soap \
        sockets \
        xsl \
        zip \
    && apk del --no-network .build-deps

# Composer
RUN curl -sS https://getcomposer.org/installer | \
    php -- --filename=composer --install-dir=/usr/local/bin && \
    php /usr/local/bin/composer clear-cache

COPY docker-php-entrypoint /usr/local/bin/

RUN chmod +x /usr/local/bin/docker-php-entrypoint

RUN useradd -m -U -s /bin/bash hostuser

RUN mkdir /home/hostuser/app && \
    chown hostuser:hostuser /home/hostuser/app

WORKDIR /home/hostuser/app

VOLUME /home/hostuser/app
@cmath10
Copy link
Author

cmath10 commented Feb 21, 2021

Solved with using FROM php:7.4-fpm-alpine3.13 & removing this:

RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories
RUN echo http://dl-cdn.alpinelinux.org/alpine/edge/community/ >> /etc/apk/repositories

@tianon
Copy link
Member

tianon commented Feb 22, 2021

Indeed, mixing Alpine's edge and stable releases has always had unexpected behavior in our experience.

If you wanted to dig deeper, it sounds like this might be related to alpinelinux/docker-alpine#146 in some way.

@yesnik
Copy link

yesnik commented Jul 22, 2021

I got the similar error with Docker version 19.03.15. After updating Docker to 20.10.7 this error is gone.

@docker-library docker-library locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants