optionnanax.blogg.se

Docker network host vs bridge
Docker network host vs bridge











docker network host vs bridge

Now, from the “ gif” below, we can confirm that the “ container1” can reach “ container2” using its name and not its IP-Address. # cat /etc/hosts Edit the hosts file of “container1” about “ container1” in the “ /etc/hosts” file of “ container2“.about “ container2” in the “ /etc/hosts” file of “ container1“.Question: What if we still want to achieve thatĪnswer: That is simple actually, simply edit the “ /etc/hosts” file of both the containers, by adding an entry: Ping from container2 to container1 using container name using default docker0 bridge Now, create two new containers using this network: .name = docker0 .default_bridge = true Containers =

Docker network host vs bridge driver#

Driver = bridge Now, check the available networks, by default on a docker host: $ docker network ls Default networks available on linux docker hostįrom the photo above, for this particular post, we are interested in the highlighted one, which is “ bridge“.īefore moving further, look at the default or stock configuration of this “ docker0” bridge network using the command below: $ docker network inspect bridge “docker0” bridge network default configurationįrom the image above, we have to note a few things:

docker network host vs bridge docker network host vs bridge

Ping containers connected to default bridge “docker0”įirst, we will check the existence of this network by the following command: $ ip a s docker0 Default docker0 bridge network on ubuntu 18.04













Docker network host vs bridge