Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js “码头工人问题”;查找:无法删除‘/usr/share/doc/nodejs’;:“目录不为空”;_Node.js_Docker - Fatal编程技术网

Node.js “码头工人问题”;查找:无法删除‘/usr/share/doc/nodejs’;:“目录不为空”;

Node.js “码头工人问题”;查找:无法删除‘/usr/share/doc/nodejs’;:“目录不为空”;,node.js,docker,Node.js,Docker,当我将我的更改推入CI/CD时,我面临一个问题,该操作失败,错误如下 STEP 25: RUN find /usr -name "*node*" -delete find: cannot delete ‘/usr/share/doc/nodejs’: Directory not empty subprocess exited with status 1 subprocess exited with status 1 error building at STEP "R

当我将我的更改推入CI/CD时,我面临一个问题,该操作失败,错误如下

STEP 25: RUN find /usr -name "*node*" -delete
find: cannot delete ‘/usr/share/doc/nodejs’: Directory not empty
subprocess exited with status 1
subprocess exited with status 1
error building at STEP "RUN find /usr -name "*node*" -delete": exit status 1
level=error msg="exit status 1"
Dockerfile build failed - exit status 1exit status 1
下面是显示错误和失败的行

RUN echo y | yum update --exclude=filesystem-3.8-3.el8.x86_64
RUN rm -rf /usr/bin/node /usr/lib/node_modules /usr/bin/node-waf /usr/include/node /usr/lib/node /usr/lib/pkgconfig/nodejs.pc /usr/share/licenses/nodejs /usr/share/nodejs /usr/share/man/man1/node.1
RUN find /usr -name "*node*" -delete
RUN find /usr -name "*npm*" -delete
因此,在运行find/usr-name“*node*”-delete之前,我已经有了
rm-rf
命令。但是错误表明目录不是空的

非常感谢您的任何帮助或建议。
谢谢

直接删除
/usr/bin
或其他系统目录中的内容通常是不好的做法。在Docker的情况下,
RUN rm
实际上不会使图像变小,因为图像的构造方式不同。你的目标是什么?猜测一下,使用a构建前端应用程序,然后将其结果复制到其他应用程序中会更好吗?