solution: Re: pgadmin4: not possible to create server - Mailing list pgsql-general

From robert
Subject solution: Re: pgadmin4: not possible to create server
Date
Msg-id 3482ea7e-1422-5226-4951-9e316561997e@redcor.ch
Whole thread Raw
In response to Re: pgadmin4: not possible to create server  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Adrian


>>> So you pgAdmin4 running in a container on your local machine and 
>>> Postgres running in the native OS(the OS is?) on your local machine. 
>>> Is the Docker container set up to 'see' the local machine?
>>
>> what do you mean by see?
>
> For fuller explanation see:
>
>
https://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach

>
>>
your hint pointed in the right direction:
it is not localhost, on which the server is running, because localhost 
is relative to the container, so it is in effect the container itself.
Postgres is running on the gatway of the containers network.
This I found out by issuing:
docker inspect reverent_volhard (where reverent_volhard is the 
containers name in which pgadmin4 runs)
this providest:
...
           "Networks": {
                 "bridge": {
                     "IPAMConfig": null,
                     "Links": null,
                     "Aliases": null,
                     "NetworkID": 
"df33249ff65c37ea1ca1f142b4a74283c4429c44c3ed1eb5ea80c695c87ab86d",
                     "EndpointID": 
"905c0c78145ef1847854f221200d8e4a7788f99b901030460111258ab9156b29",
                     "Gateway": "172.17.0.1",
                     "IPAddress": "172.17.0.2",
                     "IPPrefixLen": 16,
                     "IPv6Gateway": "",
                     "GlobalIPv6Address": "",
                     "GlobalIPv6PrefixLen": 0,
                     "MacAddress": "02:42:ac:11:00:02",
                     "DriverOpts": null
                 }

so postgres runs on 172.17.0.1

and bingo, it works

thanks again
robert


pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: pgadmin4: not possible to create server
Next
From: robert
Date:
Subject: Re: pgadmin4: not possible to create server