Now that Docker for Mac uses localhost instead of an IP, should communication between docker containers and non-docker containers be possible using localhost for all? I have docker services and non-docker services running and I need them to read from a DB in docker, but I keep getting this when calling the container for dynamodb-local.
Failed to open TCP connection to localhost:8000 (Connection refused - connect(2) for “localhost” port 8000)
In my docker-compose.yml I define the dependency
From the docker-compose networking doc (https://docs.docker.com/compose/networking/) it looks like all of the containers should be set up on a shared network to talk to each other. I can reach the running services from a browser with http://localhost:port, but not the dynamo-local container. I’m trying to figure out if I have a dynamo issue, or a docker networking issue.
My questions are
- Cross-container networking: Can the containers call each other by localhost:port (localhost:8000 for example) or can they only use the compose name like dynamodb:8000?
- Cross-system networking: Can the non-docker services running locally use the db at localhost:8000?