Question about container_name

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 will be grateful for any answer!
Thanks!

Hello,

can you explain why the answer to this question is important to you?

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.

Are you about scale factor of service?

Yes. Traefik is for professional use, so targer services will mostly have multiple containers each.

Thank you very much for your reply.

Additional note: when using Swarm, you can let Swarm do the load balancing, but it still seems to use IP, not names. (Doc)