1
I created a container on Docker and it tries to access a host called pgmaster. On the machine where Docker is installed I added the sequinte host: 10.0.0.3 pgmaster
in the /etc/hosts
. So much so when I try to make an ssh works perfectly: ssh vini@pgmaster
. But when my container tries to access pg master:
psql: could not translate host name "pgmaster" to address: Name or service not known
Yes, my container is trying to access a postgresql on the pgmaster machine. So much so that this command works perfectly on the main machine: psql mydb -h pgmaster -p 5432
Is there any place in the containers I should set the names of the hosts?