Could not translate host name "postgis"
Closed this issue · 1 comments
toton6868 commented
I built the docker locally and ran it with the following command
docker build -t PostgreSQL .
docker run --rm -ti -d --name postgis -v $(pwd):/d -p 5434:5432 PostgreSQL
I was trying to connect through psql-docker
. I have changed the Image name in the psql-docker
script. But it is showing the following error.
psql: error: could not connect to server: could not translate host name "postgis" to address: Name or service not known
cayetanobv commented
How are you trying to connect using psql-docker
? Try this command:
./psql-docker -l postgis
Anyway you can try to connect directly without psql-docker
:
docker exec -it postgis psql -h localhost -p 5432 -U postgres