主机:Windows 10,运行VirtualBox和PgAdmin。
我已经正确设置了Docker并且运行了一些容器,没有问题。现在我尝试设置Postgres。我尝试了两个:
1 https://hub.docker.com/r/paintedfox/postgresql/ 2 https://hub.docker.com/_/postgres/ 两者都有相同的问题。当我尝试从PgAdmin连接时,它说服务器没有监听。
当我运行
docker inspect postgres
我看到
"NetworkSettings": { "Bridge": "", "SandboxID": "6ad76f4d61017c44f814c5ec7ab9081a650d925a46c2b69902c4f0e5209076ce", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "5432/tcp": null }, "SandboxKey": "/var/run/docker/netns/6ad76f4d6101", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "3f14630554c972ac875cbb384725c6970d1d4d5acfba7cbc05e416b5b22f0056", "Gateway": "172.17.0.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "172.17.0.2",
我已经尝试将该IP地址作为PGAdmin中的主机。
我已经尝试使用-p 5432:5432设置容器并连接到127.0.0.1:5432。
我尝试在VirtualBox中为容器设置端口转发。
我还尝试使用Kitematic中显示的机器主机:192.168.99.100