Docker container for Postgres 9.1 not exposing port 5432 to host

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

    I had a similar problem working in a VMWare virtual machine with Lubuntu. The VM had been paused and then was restarted. The PostgreSQL Docker container was correctly mapped and listening on localhost:5432, but I always got:

    psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request.
    

    Restarting the VM solved the problem in my case.

提交回复
热议问题