任何人都可以幫我解決這個問題嗎?我正在使用Mac OS X El Capitan + Docker。無法連接Docker + PostgreSQL 9.3
Dockerfile對我的形象:
https://gist.github.com/andrealmar/bce56f7d8450990333703aa5c4ac8d61
我跑我的容器:
docker run andrealmar/postgresql:9.3
泊塢窗PS表明,我的容器運行,我做了泊塢窗檢查看該容器的IP地址爲:
docker inspect 8e65f4dec821 | grep IPAddress
輸出:
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
當我嘗試使用psql的連接:
psql -h 172.17.0.2 -U docker docker
它給了我一個超時錯誤。
psql: could not connect to server: Operation timed out
Is the server running on host "172.17.0.2" and accepting
TCP/IP connections on port 5432?
我也試着用命令:
psql -h 172.17.0.2 -p 5432 -d docker -U docker -W
但是,同樣的超時錯誤發生....
有誰知道我在這裏失蹤?
乾杯,
非常感謝你@thaJeztah 你解決了我的問題。 –