1
00:00:04,320 --> 00:00:09,900
We have just successfully agreed that the Newcastle bridge network it is called cost him and his driver

2
00:00:09,960 --> 00:00:10,890
is breech.

3
00:00:10,890 --> 00:00:17,250
And here you'll see subnet that will be used for assignment of data addresses to contain those in this

4
00:00:17,480 --> 00:00:18,990
constant network.

5
00:00:18,990 --> 00:00:24,890
No let's stop on those two containers that we have created in the fold the bridge network and afterwords.

6
00:00:24,900 --> 00:00:31,740
Let's create again two new containers in the customer network but we will look to use now does this

7
00:00:31,740 --> 00:00:32,490
name option.

8
00:00:32,549 --> 00:00:35,880
And do we want to use this age hostname option.

9
00:00:35,880 --> 00:00:39,360
We will let Docker create custom names on its own.

10
00:00:39,390 --> 00:00:40,010
Great.

11
00:00:40,020 --> 00:00:48,380
Let me exit from this CHL clear terminal here and let me exit from this CHL clear terminal as well and

12
00:00:48,410 --> 00:00:53,550
let me actually using docker container Brule remove existing containers.

13
00:00:53,550 --> 00:00:59,020
Yes and afterwords so let's get the terminal and start throws the container here.

14
00:00:59,130 --> 00:01:06,780
Using Docker run this idea Busy Box Command like so without name option and without h.

15
00:01:06,800 --> 00:01:10,000
Option but we will add additional option.

16
00:01:10,110 --> 00:01:12,740
Basically let me throw Iran here.

17
00:01:12,780 --> 00:01:14,820
Iran doesn't just help command.

18
00:01:15,090 --> 00:01:21,030
And so you option that we will use now it is there's this network option here what is.

19
00:01:21,180 --> 00:01:26,640
And with this option we are able to connect the container to a specific network.

20
00:01:26,640 --> 00:01:31,580
And again by default without this option container is attached to default.

21
00:01:31,620 --> 00:01:33,100
Breach network.

22
00:01:33,110 --> 00:01:33,730
Right.

23
00:01:33,780 --> 00:01:35,640
Let's use this option.

24
00:01:35,860 --> 00:01:37,840
Docker run this idea.

25
00:01:38,130 --> 00:01:42,530
There's Dish Network and after this parameter left it's a fight.

26
00:01:42,540 --> 00:01:49,080
Name of the cost network we want to connect this container to and in our case name is simply custom

27
00:01:49,320 --> 00:01:55,650
Let's type this name like so and afterwards Let's type name of the image we want to use for this container

28
00:01:55,890 --> 00:01:59,930
and name will be same as before Busy Box busy box.

29
00:02:00,120 --> 00:02:08,550
Let's press enter and let's verify which IP address was assigned to this busy box container host name

30
00:02:08,639 --> 00:02:16,560
this item and here you see address from network range that was assigned to our custom breach network.

31
00:02:16,590 --> 00:02:17,710
This range.

32
00:02:17,970 --> 00:02:24,120
And if I will enter here doc or network inspect custom you should see it now container that was attached

33
00:02:24,180 --> 00:02:31,050
to this custom network here on the tales about this container here with its random name queries.

34
00:02:31,200 --> 00:02:34,710
Lumi you're here with Mike address and here was IP address.

35
00:02:34,710 --> 00:02:37,730
Same as we see here in this output.

36
00:02:37,730 --> 00:02:38,500
Great.

37
00:02:38,540 --> 00:02:40,320
Let us know in the same way.

38
00:02:40,320 --> 00:02:40,800
Great.

39
00:02:40,800 --> 00:02:42,740
One more busy box container.

40
00:02:42,750 --> 00:02:44,330
Let's go to this step.

41
00:02:44,490 --> 00:02:46,610
Dr Ron this idea.

42
00:02:46,800 --> 00:02:52,250
There's this network again custom here and the name of the container image.

43
00:02:52,260 --> 00:02:52,740
Sorry.

44
00:02:52,770 --> 00:03:00,620
Music box enter and let's verify IP address of this container host named this I one hundred seventy

45
00:03:00,640 --> 00:03:02,280
two eight in 0 3.

46
00:03:02,300 --> 00:03:08,270
Let's go back to this last step and verify where's this container was attached to this custom network.

47
00:03:08,270 --> 00:03:14,570
And yes now I see here in this output two containers with different IP addresses of course here was

48
00:03:14,660 --> 00:03:15,920
also the container.

49
00:03:15,920 --> 00:03:16,860
Here it is.

50
00:03:17,180 --> 00:03:19,600
And here is second container.

51
00:03:19,670 --> 00:03:22,160
Here you see I.D. of containers here.

52
00:03:22,170 --> 00:03:23,720
I.D. on the first container.

53
00:03:23,720 --> 00:03:29,840
And here was I.D. of the second container and here they are IP addresses this one and this one.

54
00:03:29,840 --> 00:03:30,710
Wonderful.

55
00:03:30,710 --> 00:03:38,120
Let's now verify connectivity between those two busy box containers and first let's as usually use an

56
00:03:38,330 --> 00:03:42,350
IP address one hundred seventy two eight in 0 3.

57
00:03:42,350 --> 00:03:49,850
And yes I get a response from second container and dunno let's try to think by hostname let's check

58
00:03:49,850 --> 00:03:59,690
hostname of this container hostname like so here with hostname let's copy it go here and use this hostname

59
00:03:59,780 --> 00:04:03,510
with command and now I get response.

60
00:04:03,740 --> 00:04:11,470
It means that using a custom network we are able to communicate between containers using their host

61
00:04:11,480 --> 00:04:12,140
names.

62
00:04:12,290 --> 00:04:18,690
It is a very important outcome and that's how beach or difference from the fault region network where

63
00:04:18,790 --> 00:04:22,760
we are not able to communicate using code names.

64
00:04:22,760 --> 00:04:23,400
Great.

65
00:04:23,520 --> 00:04:25,040
Let's where verify where's our.

66
00:04:25,070 --> 00:04:32,800
We will be able to communicate between containers using data names remember that the names were assigned

67
00:04:32,800 --> 00:04:34,240
randomly by Dzhokhar.

68
00:04:34,510 --> 00:04:40,450
Let's clear terminal and the actually you are able to find out which names were assigned to the here

69
00:04:40,450 --> 00:04:41,590
in this section.

70
00:04:41,590 --> 00:04:44,830
Name is here for container with this IP address.

71
00:04:44,920 --> 00:04:50,920
And basically it's contain the run in my case and this through all step and name for second container

72
00:04:50,980 --> 00:04:52,000
is here.

73
00:04:52,000 --> 00:04:52,990
Here it is.

74
00:04:52,990 --> 00:04:54,520
And now using this name.

75
00:04:54,520 --> 00:05:00,020
Let me try to access second container using same bean comment from Thor's container.

76
00:05:00,040 --> 00:05:08,770
This one being and let me paste the name of second container not hostname main enter and I see that

77
00:05:08,860 --> 00:05:09,890
address.

78
00:05:09,960 --> 00:05:10,510
Great.

79
00:05:10,630 --> 00:05:17,680
That's outcome we have at the moment we are able to communicate between containers using their host

80
00:05:17,680 --> 00:05:25,120
names but false names are actually random and today are assigned to randomly and that they actually

81
00:05:25,120 --> 00:05:28,030
based on a D of specific container.

82
00:05:28,030 --> 00:05:34,230
Here you see that hostname you'll see it throws two characters of D of specific container.

83
00:05:34,360 --> 00:05:36,160
Here was actually a fool idea.

84
00:05:36,160 --> 00:05:37,870
Here it is.

85
00:05:37,870 --> 00:05:43,470
And of course it's not convenient to use a D for communication between containers.

86
00:05:43,510 --> 00:05:51,160
We also have just verified that we are not able to communicate between containers using a randomly assigned

87
00:05:51,220 --> 00:05:54,000
names this name or D name.

88
00:05:54,040 --> 00:05:57,460
Here you see response that address.

89
00:05:57,460 --> 00:05:59,800
But no let's try to lounge.

90
00:05:59,800 --> 00:06:07,440
Same to Visa box containers using custom names instead of a randomly generated but less divided of course.

91
00:06:07,480 --> 00:06:09,720
After the smallpox I'll see you in a bit.

92
00:06:09,720 --> 00:06:10,090
Bye bye.

