What is the main reason that traefik communicates with other containers by IP and not by aliases such as the name of the container (container_name from docker-compose.yml)?
Is there a technical problem with this? Or it is just faster?
I thought that if we used the internal docker's DNS resolver, we could not specify the network in traefik.docker.network=... ( in case when our app container has 1+ networks)
But actually, I'm just wondering why exactly over IP. If there is technical value in it, I would use this approach in my programs.
Traefik load balances incoming requests to the target services via their IP. When talking to a container via their service name through Docker DNS, it could not direct requests to a certain container, when using Docker service with multiple instances.