Hi!

On Sat, Dec 28, 2019 at 8:59 PM <fibreplay@gmail.com> wrote:
Hi Erik
Thanks for reply.

1. I used the following commands.- (own password)

From the data you posted below, I think the answer is that the "myledger" container can't connect to the postgresql container: it tries to connect to the postgresql container on the 'postgres' host as it is known in the 'myledger' container.

For the quick fix (just for the moment so you can try if this is the problem), you could add a line to the "/etc/hosts" file in the "myledger" container:

172.170.0.2 postgres

You can copy the /etc/hosts file in and out of the container using the 'docker copy' command and edit it on the host. After copying the edited file back in, be sure to "docker stop" and "docker start" the "myledger" container so that any caching of the old /etc/hosts data is reset.

Note that this isn't a long-term solution, because containers can get different IP addresses based on the order in which they're started.

The longer term solution is probably the '--alias' option available in docker networking as described here: https://docs.docker.com/engine/reference/commandline/network_connect/
with it, you can add a name for the database container (e.g. 'postgres') to the "myledger" container.


--
Bye,

Erik.

http://efficito.com -- Hosted accounting and ERP.
Robust and Flexible. No vendor lock-in.