I am doing some container to container communication. Container ‘A’ has port 80 exposed publicly and container ‘B’ is on the same (docker) network and is making a request.
In this situation I can use the docker container ID in the url for the request, or the public hostname of the actual machine (since port 80 of container A has been forwarded).
I am not sure which name I should be using to make the request though - any help on which one is preferable and why would be appreciated!
Service names and declared network aliases result in dns entries in the docker network that can be used to lookup containers. Either one of them is what you want to use