任何人都可以帮我解决这个问题吗?我正在使用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 你解决了我的问题。 –