docker postgres pgadmin local connection

前端 未结 16 2266
清歌不尽
清歌不尽 2020-12-02 06:44

I have created an ubuntu image with nginx, php and postgres.

I want to connect the postgres database in my current image with pgadmin located on my loca

16条回答
  •  渐次进展
    2020-12-02 06:53

    You have to expose the postgres port in the container to you local system. You do this by running your container like this:

    docker run -p 5432:5432

    when connecting with your GUI client or CLI make sure to use the ip-address not localhost even if your ip-address is the localhost ip-address.

    docker ps would give you the ip address your postgres container is on.

提交回复
热议问题