Creating DNS gateway between docker bridges


I’m running a set of containers as follows:

  • a client connected to a bridge network
  • a server connected to another bridge network
  • a gateway connected to both network

My goal is to configure these containers so the client can refer to the server by its name as it would be possible if they were on the same network.

The purpose of using the name instead of the IPs is to allow a more versatile way of developing my project and possibly to take advantage, in the future, of the docker swarm load balancer for the server.

I’m deploying everything using docker-compose v3.9 and running on ArchLinux with a docker server and client 24.0.2 and an API 1.43.

Thank you in advance and I stay at your disposal for further details