dockermakefiledockerfilealpine-linuxpodman

Alpine Container: make: /bin/sh: Operation not permitted


While running Alpine 3.20 container, make command complained about "Operation not permitted" while I have login as root.

Have been searching on the forums about the similar issue. On RHEL7 environment with limited privileges to upgrade the versions of Docker alternative, Podman. Meanwhile, upgrading to Docker/Podman service is not an option for folks. Looking for another option to change/update things in Alpine Container instead.

/tmp # docker-php-ext-install gd /bin/sh /usr/src/php/ext/gd/libtool --tag=CC --mode=compile cc -I. -I/usr/src/php/ext/gd -I/usr/src/php/ext/gd/include -I/usr/src/php/ext/gd/main -I/usr/src/php/ext/gd -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 -I/usr/include/libpng16 -I/usr/include/webp -I/usr/include/freetype2 -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -Wno-strict-prototypes -I/usr/src/php/ext/gd/libgd -DZEND_COMPILE_DL_EXT=1 -c /usr/src/php/ext/gd/gd.c -o gd.lo -MMD -MF gd.dep -MT gd.lo make: /bin/sh: Operation not permitted make: *** [Makefile:213: gd.lo] Error 127


Solution

  • Try

    apk add —upgrade gcc libc-dev bmake
    

    . Replace /usr/bin/make with /usr/bin/bmake.