[英]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.