Docker container for Postgres 9.1 not exposing port 5432 to host

前端 未结 7 1428
醉酒成梦
醉酒成梦 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:44

    Run the postgre image with the correct Port Mapping using -p <host_port>:<container_port>:

    docker run --same-options-as-step-one -d -p 5432:5432 postgres:9.1
    
    0 讨论(0)
提交回复
热议问题