Y
Y
yellow_pus2022-03-17 18:05:04
PostgreSQL
yellow_pus, 2022-03-17 18:05:04

Empty IpAddress in docker inspect postgres?

I'm trying to connect to a database in docker, I enter the default address, 172.17.0.1which, 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')

In search of an answer, I came across the opportunity to check the correctness of the address, through 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

1 answer(s)
S
SADFGHJAETJER, 2022-03-17
@SADFGHJAETJER

> 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 question

Ask a Question

731 491 924 answers to any question