创建 docker 镜像作业失败

Moh*_*lem 5 php amazon-web-services jenkins docker

当我直接在服务器上运行 dockerfile 时,它​​工作完美并构建图像,但是当我从 jenkins 运行它时,它给了我这个错误

    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
Run Code Online (Sandbox Code Playgroud)

任何想法有什么问题我以 root 身份运行此步骤但仍然存在同样的问题

des*_*ryn 2

昨天遇到同样的错误。您是否尝试过使用其他图像,例如 php:7.4-fpm-buster(或 cli)?我注意到图像前两天已经更新了。改变图像对我来说很有效。