5

I'm using Docker's Compose command with an ecs context to launch and orchestrate the containers of a web app for a branch preview feature.

The problem I have is with an Nginx proxy: it can only access the other containers using their CloudMap FQDN (services.compose-project.local), and not the short service names.

The documentation is rather clear that both should work:

Services can retrieve their dependencies using Compose service names (as they do when deploying locally with docker-compose), or optionally use the fully qualified names.

This problem is specific to the Nginx container; the other containers can reach each other using both short names and FQDN just as expected.

Docker's internal DNS server does not seem to be available in ECS:

send() failed (111: Connection refused) while resolving, resolver: 127.0.0.11:53

The default AWS VPC DNS resolver 169.254.169.253 is responsive, but cannot resolve short names:

32#32: *1 webapp could not be resolved (3: Host not found)

What am I missing?

Localist
  • 1,094
  • 1
  • 8
  • 14
  • this might be helpful: https://stackoverflow.com/questions/42547619/docker-container-cant-resolve-dns-to-reach-another-aws-ec2-machine –  Apr 18 '22 at 16:11
  • @user973254 unfortunately, that's not an option when you're using Docker with ECS. – Localist Apr 18 '22 at 21:41
  • did you manage to resolve this @Localist? – mrRobot Feb 12 '23 at 15:41
  • Unfortunately no. Settled with the cloud map FQDN solution. – Localist Feb 13 '23 at 11:41
  • @Localist did you have to do anything else (like override the resolver maybe)? or just use the FQDN? I have the same setup and my nginx can't even resolve the FQDN, can you share an example nginx conf file? – Meidan Alon Feb 16 '23 at 21:53

0 Answers0