when i run the the dockerfile on the server directly its working perfect and build the image but when i run it from jenkins it give me this error
Step 5/67 : RUN pecl install xdebug-3.0.4 && docker-php-ext-enable xdebug
---> Running in 111bf1524f04
downloading xdebug-3.0.4.tgz ...
Starting to download xdebug-3.0.4.tgz (215,870 bytes)
.............................................done: 215,870 bytes
87 source files, building
running: phpize
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
building in /tmp/pear/temp/pear-build-defaultuser2CL8YH/xdebug-3.0.4
running: /tmp/pear/temp/xdebug/configure --with-php-config=/usr/local/bin/php-config
ls: cannot access '.': Operation not permitted
configure: error: working directory cannot be determined
ERROR: `/tmp/pear/temp/xdebug/configure --with-php-config=/usr/local/bin/php-config' failed
The command '/bin/sh -c pecl install xdebug-3.0.4 && docker-php-ext-enable xdebug' returned a non-zero code: 1
any ideas what is the problem i run this step as root and still same problem
Ran into the same error yesterday. Have you tried using another image, e.g. php:7.4-fpm-buster (or cli)? I noticed that the images have been updated two days ago. Changing the image did the trick for me.
I just ran your error too with various different commands. This appears to be a change introduced to the upstream dependency Moby which goes into Alpine Linux which goes into the PHP image.
Two solutions:
Short term: Pin your image to a previous version, e.g. php:7.3.28-apache (7.3.29 is broken on Docker 19 for me).
Long term: Upgrade Docker to 20.10.0+ AND libseccomp 2.4.4+ AND runc 1.0.0-rc93+ (read Alpine 3.14.0 release notes.
Sources:
https://github.com/docker-library/php/issues/1177
https://github.com/moby/moby/pull/41353
https://github.com/moby/moby/commit/a18139111d8a203bd211b0861c281ebe77daccd9
https://github.com/alpinelinux/docker-alpine/issues/182
https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0
i removed docker and installed newer version and problem solved