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.
Docker Compose is a tool used to define and run multi-container Docker applications. Users utilize this software to launch, execute, communicate, and close containers with a single coordinated command. This tutorial will show you how to install Docker Compose on CentOS 7. 使用docker pull从镜像仓库拉取镜像时报错如下: root@docker-registry # docker pull centos Using default tag: latest Trying to pull repository docker.io/library/centos.
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
patient-processor:
image: matchbox/nci-match-patient-processor:latest
entrypoint: /docker-compose-env.sh
depends_on:
- dynamodb
ports:
- '3010:3010'
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- RAILS_ENV=development
dynamodb:
image: matchbox/dynamodb-local:latest
ports:
- “8000:8000”
Installing Docker In Centos
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
Update Docker In Centos
- 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?