[英]Odoo container : Database connection failure: could not connect to server: Connection refused (linking odoo with localhost postgres)
我正在尝试运行 odoo docker 容器并将其与我的本地(非容器)postgresql 链接。
我试过这个命令(如建议here )。
docker container run -p 8089:8069 -e HOST=127.0.0.1 -e USER=tux -e PASSWORD=tux --name odoo -t odoo
运行它并得到这些错误:
Database connection failure: could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
我试图用 ufw 打开端口 5432 但得到了同样的错误。 我也尝试将 127.0.0.1 更改为 0.0.0.0 但什么也没有。
你可以帮帮我吗?
ps:USER和PASSWORD是正确的,我在本地运行odoo实例时使用它们。
您可能需要使用标志--network=host
添加主机网络
WARNING: Published ports are discarded when using host network mode
,已WARNING: Published ports are discarded when using host network mode
,这意味着您无法更改端口绑定。 这和你的机器一样安全。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.