[ECS] [question]: host.docker.internal or equivalent
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 334
- PR merge metrics
- No merged PRs in 30d
Description
Apologies if this is the wrong place for this question.
If I have a deamon ECS service running on each instance in my cluster, bound to a static port, is there an easy way to communicate with it from another task on the same instance? I've been following this issue https://github.com/docker/for-linux/issues/264 for a while, and have followed the workarounds for it, which work fine but aren't ideal.
Currently I'm building my docker images to include that startup script to run the ip/route commands and add `host.docker.internal` to the hosts file, and then just configure my app to point to that host name. Once that github issue is resolved I'll be able to just use a normal docker image without extra modification and keep pointing to the same host name. Until then, is there an ip address I could use instead? For example, on my local windows machine, I know I can use 10.0.75.1 from within a container to reach the host, but that is configurable and not guaranteed to be the same on all machines.
Does ECS somehow configure docker to use a reliable ip address I could point to or would it be potentially different on each instance? Another workaround would be to query the instance metadata at startup for private ip address, but that is about the same as what I've got - but maybe there's a way to assign an environment variable to the task that is late-bound to the instance private ip address? (not that the private ip is the same as the docker bridge address but it could work as well)
Contributor guide
Research direction
Start by reviewing the linked Docker for Linux issue and the ECS networking behavior described here. The issue does not name repository files, tests, or an implementation entry point, and it does not define a concrete acceptance criterion beyond finding a reliable host address or late-bound task value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker
- Domain
- cloud, networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100