Hi, guys. I am new to docker and I am trying to resolve this question…
I know that the containers can access each other if I specify the network like:
docker run -dit --name ub1 --network but ubuntu
docker run -dit --name ub2 --network ubt ubuntu
So the command ping ub2
can work inside the container ub1.
But, if I did not specify the --network
settings and I think the container is created under the network bridge
or null
?
Is that mean the containers are under the same network if I do not specify the --network
settings? Apparently, ub3
can not access ub4
by container name… So why?
docker run -dit --name ub3 ubuntu
docker run -dit --name ub4 ubuntu
However, even if I specify the network under bridge
, it still can not access each other by container name. Why?
docker run -dit --name ub5 --network bridge ubuntu
docker run -dit --name ub6 --network bridge ubuntu
$ docker exec -it ub8 /bin/bash
root@dc399b0c1b2e:/# ping ub5
ping: ub5: Name or service not known
Also, Is this correct:
docker0
= network bridge
?