solution: Re: pgadmin4: not possible to create server

From: robert <robert(at)redcor(dot)ch>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: solution: Re: pgadmin4: not possible to create server
Date: 2018-02-06 23:02:09
Message-ID: 3482ea7e-1422-5226-4951-9e316561997e@redcor.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message robert 2018-02-06 23:11:28 Re: pgadmin4: not possible to create server
Previous Message Adrian Klaver 2018-02-06 22:33:30 Re: pgadmin4: not possible to create server