Answer the question
In order to leave comments, you need to log in
Empty IpAddress in docker inspect postgres?
I'm trying to connect to a database in docker, I enter the default address, 172.17.0.1
which, in theory, should work inside the container, but instead an error occurs
SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "172.17.0.1" and accepting
TCP/IP connections on port 5432? (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
docker-inspect <id-postgresql>
the line "IPAddress":. I repeated all this, but instead of the address in IPAddress, there is an empty string"IPAddress": "",
Answer the question
In order to leave comments, you need to log in
> default address, 172.17.0.1 Where
from the container? To another container or just to the host? If another container - can it be easier to stick services into one network or take compose? 172.17.0.1 probably means the internal IP address, use host.docker.internal, it will resolve itself to the host address. Well, or find out the current internal IP.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question