I have two Docker containers running on two different hosts:
- Computer A (PC, uses Ethernet), ip 192.168.0.11 [ Docker container running inside on 172.17.0.2 ], OS Windows 7
- Computer B (laptop, uses WLAN), ip 192.168.0.12 [ Docker container running inside on 172.17.0.2 ], OS Linux Ubuntu
I would like to somehow connect them, so they could communicate with each other (e.g. via ssh).
I have tried to "link" my containers by running them with:
docker run --name master_node --rm -it branislava/ubuntu1504java8:v1 docker run --rm -it --link master_node:master_node1 --name slave_node branislava/ubuntu1504java8:v1
As suggested in comments. This is working; containers can communicate - but only when they are run on the same host machine.
How could this be accomplished for containers that are running on different machines in the same local network?