- Mais recentes
- Mais votos
- Mais comentários
Hello.
I am using the bridge network mode as it seems it's the only way to link my containers together. Should I be usingawsvpc as the network mode? If so, how can I link/get the containers to talk to eachother on different ports?
It is possible to communicate even in "awsvpc" mode.
When using "awsvpc" mode, you need to place the container within the same task and communicate using "localhost:port number".
https://stackoverflow.com/questions/47637588/linking-container-in-aws-fargate
Alternatively, you can make the container a separate task and use something like Service Connect configuration.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-connect.html
When using "bridge" mode, the following tutorial may be helpful.
Since it uses the "link" setting, the container name and port number are required when connecting.
https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Setup-nginx-ecs.html
When using the bridge network mode, I set both the host & container port to 8080 as that how I run it on my local machine. Should I be doing this differently?
If you want to use the same port for the host and container, it may be better to use host mode.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/networking-networkmode-host.html
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos
- AWS OFICIALAtualizada há um ano
- AWS OFICIALAtualizada há 2 meses
- AWS OFICIALAtualizada há 2 anos