Scaling a service: three api containers
Select an icon to see what it is.
Step 3 of 6
The name api returns all three
When web looks up api, the embedded DNS server at 127.0.0.11 answers with every address that has that alias. Docker shuffles them into a random order on each lookup, so different lookups can lead with different containers.
$ docker compose exec web getent ahostsv4 apiDNS answer (decoded message, example: the order is random)
api A 172.18.0.3api A 172.18.0.5api A 172.18.0.6