Reputation: 3
I have a task definition that contains 4 containers and they need to communicate with each other.
I already tried to use the name of the container (passer by environment variable) to try to get them to communicate, but it didn't work. With that in mind I don't think using the repository name (ECR) will work. What can I do to get the containers to communicate?
OBS: I’m using the aws web interface
Upvotes: 0
Views: 375
Reputation: 2123
I think you need to create a specific task definition for each docker image then create ecs service based on each task definition you have been created in the previous step, and to manage the communications between ecs services you have many option like loadbalancer, cloud map, or ecs service discovery with I prefer in term of cost and scalability. the following blog maybe helpful.blog link
Upvotes: 0
Reputation: 6063
All containers in a task definition
can talk to each others via localhost
because they share the same network space. So if container1 exposes a service on port 1234
you can call it with localhost:1234
from any other container.
Upvotes: 1