I need to implement solution when there are DB and Data Processor. Both are on separated containers. Those containers are on another container "Docker 1". I need to run multiple times this last container "Docker 1", "Docker 2"... It could be complicated so there is a image
There is Docker file to run DB and Data processor:
version: '3'
services:
db:
image: "..."
ports:
- "1521"
networks:
default:
aliases:
- oracle
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
data_processor:
image: "..."
ports:
- "8321"
- "6003"
networks:
default:
aliases:
- processor
privileged: true
user: root
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
command: tail -f /dev/null
and docker file to run multiple dockers:
version: '3'
services:
docker1:
image: ...
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
command: tail -f /dev/null
user: root
docker2:
image: ...
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
dns:
command: tail -f /dev/null
user: root
....
dockerx:
....
I am getting IP and mapped DB port by command:
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'
The problem is that Data Processor cannot connect ro DB by using those IP:Port. Where is the problem?