Containers can't communicate with each other #2716
Comments
I tried making it more explicit, but it still doesn't work. #cloud-config
rancher:
registry_auths:
"registry.gitlab.com":
auth: REDACTED
services:
webapp:
image: registry.gitlab.com/REDACTED/webapp/webapp:latest
restart: always
ports:
- "80:3000"
networks:
- foobar
redis:
image: redis:5.0.3-alpine
container_name: redis
ports:
- "6379:6379"
networks:
- foobar
networks:
ssltimer:
driver: bridge
name: foobar Also, it seems that
|
It must be an issue with the default Docker engine (18.x.x). This fixed the config (the one with docker:
engine: docker-17.12.1-ce I wonder if Rancher OS has some Docker 18 compatibility issues that need to be addressed. It doesn't seem right that, by default, containers cannot communicate with each other by their name. For that reason, although I have a workaround, I'm not going to close this issue. |
@steve-taylor Seems cannot reproduce your issue.
|
@Jason-ZW thanks for your detailed example. It looks like additional configuration is required when using Docker engine 18 vs 17. I’m not sure if this is called out anywhere. The documentation is quite thin. I’ll give this a try and see if it works in my case. |
network:
interfaces:
eth0:
dhcp: true
eth1:
dhcp: true
lo:
address: 127.0.0.1/8 This seems to have broken the network. I'm getting |
I had the same issue. |
RancherOS Version: 1.5.1
Where are you running RancherOS? DigitalOcean
My cloud config specifies two containers. One is based on Node.js and the other is Redis. They should be able to communicate with each other using their container names, but
webapp
cannot connect toredis
usingredis
as the host name.From
docker logs redis
:The text was updated successfully, but these errors were encountered: