Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/10.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
Bash 由于应用程序原因,无法执行到docker容器中_Bash_Postgresql_Docker - Fatal编程技术网

Bash 由于应用程序原因,无法执行到docker容器中

Bash 由于应用程序原因,无法执行到docker容器中,bash,postgresql,docker,Bash,Postgresql,Docker,昨天我重新启动了数据库的docker容器。我的应用程序仍然可以正常连接,但是: 下面的行不再工作 docker exec -i -t database_1 bash 相反,它给了我一个错误: unable to find user postgres: no matching entries in passwd file 我不知道为什么它不仅给了我bash,它看起来好像你在Dockerfile中切换到了另一个用户,但从未创建过它。试试这个: docker exec -it --user roo

昨天我重新启动了数据库的docker容器。我的应用程序仍然可以正常连接,但是:

下面的行不再工作

docker exec -i -t database_1 bash
相反,它给了我一个错误:

unable to find user postgres: no matching entries in passwd file

我不知道为什么它不仅给了我bash,它看起来好像你在Dockerfile中切换到了另一个用户,但从未创建过它。试试这个:

docker exec -it --user root database_1 /bin/bash

这是docker的某种缺陷。显然,docker停止;docker start会解决的,使用docker cp可能会导致这种情况发生。

同样的问题无法找到用户根目录:如果我使用docker exec-it-user 0数据库\u 1/bin中的数字id,则passwd文件中没有匹配项/bash@Jordan你把/etc/passwd或/etc/shadow文件搞砸了吗?我这辈子都没碰过这两个文件。postgres是否可能对其进行了一些更改?@Jordan共享您的Dockerfile?这是一个重复的问题,是由已知的docker bug引起的。看见