Unable to find user root: no matching entries in passwd file in Docker

China☆狼群 提交于 2019-11-29 10:46:44

This issue is caused by a docker engine bug but which is tracked privately, Docker is asking users to restart the engine!

It seems that the bug is likely to be older than two years!

https://success.docker.com/article/ucp-health-checks-fail-unable-to-find-user-nobody-no-matching-entries-in-passwd-file-observed

https://forums.docker.com/t/unable-to-find-user-root-no-matching-entries-in-passwd-file/26545/7

... what can I say, someone is doing his best to get more funding.

You can use this command to access to the container with root user:

docker exec -u 0 -i -t {container_name_or_hash} /bin/bash

try debug with that. i think the script maybe remove or disable root user.

Its a Long standing issue, duplicated on my old version 1.10.3 to at least 1.17

As mentioned by @sorin the the docker forum says Running docker stop and then docker start fixes the problem but is hardly a long-term solution...

The docker exec -u 0 -i -t {container_name_or_hash} /bin/bash solution also in the same forum post mentioned here by @ObranZoltan might work for you, but does not work for many. See my output below

$ sudo docker exec -u 0 -it berserk_nobel /bin/bash 
exec: "/bin/bash": stat /bin/bash: input/output error
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!