Any opportunity to create containers on different networks of the same host for communication? Please note that I am not using dockers at the moment.
The following is a summary of what I have done. I created two networks using the following commands
docker network create
docker network create
Then I ran two containers on each of these networks created using the commands:
docker run --net=mynetwork1 -it name=mynet1container1 mycontainerimage
docker run --net=mynetwork1 -it name=mynet1container2 mycontainerimage
docker run --net=mynetwork2 -it name=mynet2container1 mycontainerimage
docker run --net=mynetwork2 -it name=mynet2container2 mycontainerimage
Then I identified the IP addresses of each of the containers from the networks created using
docker network inspect mynetwork1
docker network inspect mynetwork2
Using those that I was able to communicate between containers on the same network, but I could not communicate between containers on networks. Communication is possible only by adding containers to the same network.
Many thanks...