We have just successfully agreed that the Newcastle bridge network it is called cost him and his driver
is breech.
And here you'll see subnet that will be used for assignment of data addresses to contain those in this
constant network.
No let's stop on those two containers that we have created in the fold the bridge network and afterwords.
Let's create again two new containers in the customer network but we will look to use now does this
name option.
And do we want to use this age hostname option.
We will let Docker create custom names on its own.
Great.
Let me exit from this CHL clear terminal here and let me exit from this CHL clear terminal as well and
let me actually using docker container Brule remove existing containers.
Yes and afterwords so let's get the terminal and start throws the container here.
Using Docker run this idea Busy Box Command like so without name option and without h.
Option but we will add additional option.
Basically let me throw Iran here.
Iran doesn't just help command.
And so you option that we will use now it is there's this network option here what is.
And with this option we are able to connect the container to a specific network.
And again by default without this option container is attached to default.
Breach network.
Right.
Let's use this option.
Docker run this idea.
There's Dish Network and after this parameter left it's a fight.
Name of the cost network we want to connect this container to and in our case name is simply custom
Let's type this name like so and afterwards Let's type name of the image we want to use for this container
and name will be same as before Busy Box busy box.
Let's press enter and let's verify which IP address was assigned to this busy box container host name
this item and here you see address from network range that was assigned to our custom breach network.
This range.
And if I will enter here doc or network inspect custom you should see it now container that was attached
to this custom network here on the tales about this container here with its random name queries.
Lumi you're here with Mike address and here was IP address.
Same as we see here in this output.
Great.
Let us know in the same way.
Great.
One more busy box container.
Let's go to this step.
Dr Ron this idea.
There's this network again custom here and the name of the container image.
Sorry.
Music box enter and let's verify IP address of this container host named this I one hundred seventy
two eight in 0 3.
Let's go back to this last step and verify where's this container was attached to this custom network.
And yes now I see here in this output two containers with different IP addresses of course here was
also the container.
Here it is.
And here is second container.
Here you see I.D. of containers here.
I.D. on the first container.
And here was I.D. of the second container and here they are IP addresses this one and this one.
Wonderful.
Let's now verify connectivity between those two busy box containers and first let's as usually use an
IP address one hundred seventy two eight in 0 3.
And yes I get a response from second container and dunno let's try to think by hostname let's check
hostname of this container hostname like so here with hostname let's copy it go here and use this hostname
with command and now I get response.
It means that using a custom network we are able to communicate between containers using their host
names.
It is a very important outcome and that's how beach or difference from the fault region network where
we are not able to communicate using code names.
Great.
Let's where verify where's our.
We will be able to communicate between containers using data names remember that the names were assigned
randomly by Dzhokhar.
Let's clear terminal and the actually you are able to find out which names were assigned to the here
in this section.
Name is here for container with this IP address.
And basically it's contain the run in my case and this through all step and name for second container
is here.
Here it is.
And now using this name.
Let me try to access second container using same bean comment from Thor's container.
This one being and let me paste the name of second container not hostname main enter and I see that
address.
Great.
That's outcome we have at the moment we are able to communicate between containers using their host
names but false names are actually random and today are assigned to randomly and that they actually
based on a D of specific container.
Here you see that hostname you'll see it throws two characters of D of specific container.
Here was actually a fool idea.
Here it is.
And of course it's not convenient to use a D for communication between containers.
We also have just verified that we are not able to communicate between containers using a randomly assigned
names this name or D name.
Here you see response that address.
But no let's try to lounge.
Same to Visa box containers using custom names instead of a randomly generated but less divided of course.
After the smallpox I'll see you in a bit.
Bye bye.