Docker version 18.03.0-ce, build 0520e24
Hi everyone, I’m having trouble accessing one service from inside another by its name.
Here is the docker-compose.yml:
version: “3.6”
services:
rest:
image: restimage
environment:
- “MONGO_URL=${MONGO_URL}”
deploy:
replicas: 1
ports:
- “8081:8081”
scraper:
image: scrimage
depends_on:
- rest
deploy:
replicas: 1
scraper has the code that is trying to reach rest:8081 and is failing.
Before it was solved using links but they got deprecated.
I tried creating custom network which didn’t help.
Thank you!
Addition: I ran ping rest
inside scraper and it returns
ping: unknown host rest
but then it pings some internal IP address.