我使用以下命令运行Postgres SQL数据库容器:当然,我已经将“localhost”更改为“db”,因为我试图连接这个容器。当我试图连接到容器数据库时,我会得到以下错误:
psycopg2.OperationalError: could not translate host name "db" to address: Na
我从了解到,如果不使用用户定义的网桥网络,我就不能使用docker来查找使用它们的主机名的容器。user_defined_bridge" is declared as external, but it is not in the right scope: "local" instead of "swarm"
我能够创建一个覆盖网络并在撰写文件中定义它码头网络ls的结果