postgis / docker-postgis

Docker image for PostGIS
https://hub.docker.com/r/postgis/postgis/
MIT License
1.37k stars 462 forks source link

Update command to connect to PG database in README #240

Closed amercader closed 3 years ago

amercader commented 3 years ago

Refs #234 Use docker exec on the running container rather than booting up another postgres container to connect to the database

phillipross commented 3 years ago

Looks go to me. Thanks for the contribution!

ImreSamu commented 3 years ago

IMHO: there are multiple alternative use cases and I will keep the old general method.
( so show both versions) in the https://hub.docker.com/_/postgres/ - there is a similar "How to use this image" part

phillipross commented 3 years ago

IMHO: there are multiple alternative use cases and I will keep the old general method. ( so show both versions) in the https://hub.docker.com/_/postgres/ - there is a similar "How to use this image" part

Actually, I agree with @ImreSamu and thought that I remembered references in the official postgres documentation, but I wasn't able to find them when the issue (#234) was initially submitted.

I think both should be shown: both using the networking connection from outside the container as well as directly invoking psql inside the container. After looking closer, I see that the official postgres image doesn't use container links (the old way) but uses a network connection (the more modern way) to connect the client container to the server container. Without a doubt, connecting via a network remains a significant use case even today, and is very relevant with respect to how the server container is configured regarding authentication and external network connections.

@amercader do you understand what we are referring to here? If so, can you update the PR with changes to show both, referring to the official postgres images where it is demonstrated how the network connection is made?

amercader commented 3 years ago

@phillipross I understand and I'll update the PR

amercader commented 3 years ago

@phillipross @ImreSamu let me know if the updated docs make sense

phillipross commented 3 years ago

@amercader The updated docs did make sense. I've merged the PR, and the new docs on are now live on docker hub. Thanks for your contribution!

ImreSamu commented 3 years ago

@amercader: Thank you! :+1: