[英]unable to find user root: no matching entries in passwd file
I have a running Docker container with the following:我有一个正在运行的 Docker 容器,其中包含以下内容:
docker exec -it cc58908a8dc2 /bin/bash
I ran this command before on other containers and it worked just fine.我之前在其他容器上运行过这个命令,它工作得很好。 Now, however, I'm getting this issue:
但是,现在我遇到了这个问题:
unable to find user root: no matching entries in passwd file
My Dockerfile
has the following contents:我的
Dockerfile
有以下内容:
# We will be running our Spark jobs as `root` user.
USER root
# Working directory is set to the home folder of `root` user.
WORKDIR /root
Any idea of what could cause this?知道什么可能导致这种情况吗?
Sometimes, after restarting the Docker container that message appears. 有时,重新启动Docker容器后会出现该消息。
If instead of restarting like this: docker restart cc58908a8dc2
如果不是像这样
docker restart cc58908a8dc2
I stopped and started the container like this: 我停下来,像这样启动容器:
docker stop cc58908a8dc2
docker start cc58908a8dc2
Then the error disappeared. 然后错误消失了。
If you want to get this fixed please remember to comment on https://forums.docker.com/t/unable-to-find-user-root-no-matching-entries-in-passwd-file/26545/9 如果你想修复此问题,请记得发表评论https://forums.docker.com/t/unable-to-find-user-root-no-matching-entries-in-passwd-file/26545/9
Also use the feedback button from the KB article documenting how to restart docker engine when you encounter it: https://success.docker.com/article/ucp-health-checks-fail-unable-to-find-user-nobody-no-matching-entries-in-passwd-file-observed 还可以使用知识库文章中的反馈按钮 ,记录如何在遇到Docker引擎时重新启动它: https : //success.docker.com/article/ucp-health-checks-fail-unable-to-find-user-nobody-无匹配条目合的passwd文件-观察
It seems that the internet is full with others randomly encountering this bug. 似乎互联网已满,其他人随机遇到这个错误。
To get an idea about which change you have to encounter it, take at look at http://status.openstack.org/elastic-recheck/index.html#1803544 which is a graph of bug occurence on OpenStack CI jobs, occurds daily. 要了解您必须遇到的更改,请查看http://status.openstack.org/elastic-recheck/index.html#1803544 ,这是OpenStack CI作业中出现错误的图表,每天都会发生。
I know that any software has bugs and that it takes time to fix them, but this bug left me.... more than two years old and the only feedback from Docker was "tracker privatly" and "restart docker". 我知道任何软件都有错误并且需要时间来修复它们,但是这个错误让我失去了......两年多以来,Docker唯一的反馈就是“跟踪器私有”和“重启docker”。
Restarting containers usually helps (see @octavian answer).重新启动容器通常会有所帮助(请参阅 @octavian 答案)。 If it is not an option try:
如果它不是一个选项,请尝试:
docker exec -it -u 0 cc58908a8dc2 /bin/bash
docker exec -it -u 0 cc58908a8dc2 /bin/bash
where cc58908a8dc2 is the name of your container其中cc58908a8dc2是您的容器的名称
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.