Containers on the same network are connected to each other.
You need to create a network for these containers.
docker network create
When starting containers, you must specify the network.
docker run -it --net=isolated_network --name container1 container1-image bash docker run -it --net=isolated_network --name container2 container2-image bash
after you have created containers, you can ping other containers on the same network using only the container name.
root@container1 ping container2 root@container2 ping container1
Relu mesaros
source share