Docker container for Postgres 9.1 not exposing port 5432 to host

前端 未结 7 1429
醉酒成梦
醉酒成梦 2020-12-23 20:18

I\'m trying to use a Docker container to run a PostgreSQL server, and connect with it from my host machine.

My configuration is:

  • Host machine: Mac OS X
7条回答
  •  隐瞒了意图╮
    2020-12-23 20:34

    I had a similar issue. My problem was simply 0.0.0.0 not mapping to localhost so I just had to add to psql

    psql --host=0.0.0.0
    

    This is presuming

    docker port 
    

    outputs

    5432/tcp -> 0.0.0.0:5432
    

提交回复
热议问题