1
00:00:04,230 --> 00:00:11,220
We have just assigned two busy books contain those two newly created custom breach network and we can

2
00:00:11,220 --> 00:00:18,120
verify that we are able now to communicate between containers using their host names but drawback is

3
00:00:18,120 --> 00:00:20,800
that the host names are randomly generated.

4
00:00:20,880 --> 00:00:27,180
They are based on ideas of containers and it's really not convenient to use those randomly generated

5
00:00:27,210 --> 00:00:28,320
ideas.

6
00:00:28,320 --> 00:00:34,500
Also we have found out that we are not able to communicate between containers using names or randomly

7
00:00:34,500 --> 00:00:37,660
generated names for those containers.

8
00:00:37,740 --> 00:00:38,460
Wonderful.

9
00:00:38,460 --> 00:00:44,660
Let's now try to create the same two containers but now with custom names let's do that.

10
00:00:45,000 --> 00:00:52,430
Let's exit from this container and let's exit from this container like so and let's around new container

11
00:00:52,440 --> 00:00:52,930
here.

12
00:00:53,220 --> 00:00:57,770
Dr. Ron this idea does desk network.

13
00:00:57,870 --> 00:00:59,080
Same as before.

14
00:00:59,100 --> 00:01:00,960
Here we'll be custom network.

15
00:01:00,960 --> 00:01:01,830
Next let's.

16
00:01:01,840 --> 00:01:07,310
Because if I custom name there is this name here will be a Busy Box one.

17
00:01:07,440 --> 00:01:10,560
And next the common name of the image busy box.

18
00:01:10,590 --> 00:01:17,590
Like so let's lounge it and let's do the same with second Busy Box container dock.

19
00:01:17,610 --> 00:01:19,010
Wrong desk idea.

20
00:01:19,020 --> 00:01:23,800
There's this network custom there's this name and name.

21
00:01:23,800 --> 00:01:26,390
We'll be a busy books too.

22
00:01:26,460 --> 00:01:28,380
And here will be the name of the image.

23
00:01:28,410 --> 00:01:29,490
Same as before.

24
00:01:29,490 --> 00:01:30,830
Busy Box.

25
00:01:30,930 --> 00:01:32,470
Let's start it.

26
00:01:32,550 --> 00:01:40,320
We are in C H shell and now let's try it to being a fairly busy box container using its name Busy Box

27
00:01:40,320 --> 00:01:47,570
one being busy box one and now I get a response.

28
00:01:47,710 --> 00:01:55,660
It means that now we are able to communicate between containers using data custom names not random names

29
00:01:55,720 --> 00:01:56,650
with random names.

30
00:01:56,650 --> 00:01:59,750
It doesn't work but with custom does.

31
00:02:00,100 --> 00:02:08,509
Also let's go to first visible container and verify all positive connectivity of being busy books too.

32
00:02:08,650 --> 00:02:10,130
And I'll get the response.

33
00:02:10,150 --> 00:02:11,650
Same as before.

34
00:02:11,830 --> 00:02:16,750
Again notice that we are using names not host names you file.

35
00:02:16,750 --> 00:02:17,990
Have a look at hostname.

36
00:02:18,130 --> 00:02:21,250
It will be again randomly assigned like this.

37
00:02:21,250 --> 00:02:27,900
And again you are still able to connect to this container using its hostname but it's not convenient.

38
00:02:27,910 --> 00:02:29,710
Let's go to these CBC Books.

39
00:02:29,710 --> 00:02:36,160
I have copied to that idea and use it in command and I'll get a response as well.

40
00:02:36,190 --> 00:02:36,730
Wonderful.

41
00:02:37,090 --> 00:02:43,560
Let's now use Docker inspired comment in order to read the tales about specific contain that is currently

42
00:02:43,560 --> 00:02:43,980
run.

43
00:02:44,500 --> 00:02:49,690
Let's go to this last step and let's actually forced to read again details about custom network.

44
00:02:49,720 --> 00:03:00,220
Let's clear timing no Docker or network inspect custom and here I I'll see two containers that are currently

45
00:03:00,310 --> 00:03:05,530
assigned to this custom network heroes heroes container and here was second container.

46
00:03:05,650 --> 00:03:12,460
And now you see those customarily assigned names busy bookstore and busy box one.

47
00:03:12,550 --> 00:03:20,920
Let's now have a look at containers door on B.S. And now let's use Docker inspect command in order to

48
00:03:20,920 --> 00:03:22,900
read the tales about busy books.

49
00:03:22,900 --> 00:03:26,430
One container busy books one.

50
00:03:26,890 --> 00:03:30,800
And here in this output you'll see the tales about specific container.

51
00:03:30,910 --> 00:03:32,430
It is in my case busy books.

52
00:03:32,440 --> 00:03:35,020
One container here is its IP address.

53
00:03:35,020 --> 00:03:38,490
It is assigned from the costume breach network range.

54
00:03:38,500 --> 00:03:44,980
Here is Gateway and this IP address is assigned actually to Docker host that acts as a gateway for all

55
00:03:44,980 --> 00:03:48,500
containers that are attached to this custom breached network.

56
00:03:48,520 --> 00:03:53,780
And also if I'll scroll up you should see L.A. has a section and now it is not empty.

57
00:03:53,800 --> 00:03:58,420
Here you see actually hostname of this specific container.

58
00:03:58,420 --> 00:04:02,500
But name of the container is not listed here in this output.

59
00:04:02,580 --> 00:04:08,080
I would actually listed here as well because as we have verified we are able now to communicate with

60
00:04:08,080 --> 00:04:09,580
container using its name.

61
00:04:09,940 --> 00:04:16,779
And under the hood actually there was additional alias for this container and this alias is its name.

62
00:04:17,170 --> 00:04:20,100
But it is for some reason not listed here.

63
00:04:20,290 --> 00:04:27,220
But anyway we are able to communicate now between containers using ice on day of names or host names

64
00:04:27,430 --> 00:04:31,330
and it is a great benefit of using custom networks.

65
00:04:31,540 --> 00:04:37,210
Also in the same way you are able to inspect the second container using Docker inspect Busy Box to command

66
00:04:38,020 --> 00:04:42,240
and you'll see the dailies about this second container here was its IP address.

67
00:04:42,250 --> 00:04:45,560
Same gateway as for Busy Box one container.

68
00:04:45,640 --> 00:04:51,470
And also you'll see LDS that holds the idea of this container and the somewhere above.

69
00:04:51,490 --> 00:04:55,940
You should also find the hostname sorry name of this container.

70
00:04:55,960 --> 00:05:01,890
Let me look somewhere at the beginning of this output a bit down.

71
00:05:01,930 --> 00:05:02,250
Yes.

72
00:05:02,260 --> 00:05:05,080
Here with this name of this container is listed here.

73
00:05:05,200 --> 00:05:07,520
Busy Box too wonderful.

74
00:05:07,570 --> 00:05:14,050
This how we we are able to create connectivity between two containers in the custom network.

75
00:05:14,290 --> 00:05:19,760
And again now we are able to communicate between containers using their names.

76
00:05:19,840 --> 00:05:22,790
And let me show you why it is important.

77
00:05:22,900 --> 00:05:24,590
Let me exits from this container.

78
00:05:24,610 --> 00:05:26,330
It is a busy box one.

79
00:05:26,650 --> 00:05:33,670
Let's now list containers Docker because there was only one busier box to contain the running but there

80
00:05:33,670 --> 00:05:34,700
was no stopped.

81
00:05:34,720 --> 00:05:36,070
Busy Box the one container.

82
00:05:36,110 --> 00:05:41,080
Dr. Pierce this a here was stopped on the least busy box.

83
00:05:41,290 --> 00:05:42,480
One this one.

84
00:05:42,550 --> 00:05:46,570
And now let's try to start over this busy box.

85
00:05:46,600 --> 00:05:54,910
One container using Docker start to come and start this idea basically before starting.

86
00:05:55,030 --> 00:06:03,640
Let me go to visit book store and try it to be in a busy box now being busy books one.

87
00:06:03,760 --> 00:06:10,420
And of course I'll get the response bat address because now busy box one is not reachable but no less

88
00:06:10,420 --> 00:06:17,110
thought container over again Docker I'll start this idea and here it will be simply the name of the

89
00:06:17,110 --> 00:06:17,890
container.

90
00:06:17,890 --> 00:06:23,430
We don't need to specify in network settings or custom name because this container already exists.

91
00:06:23,470 --> 00:06:26,730
We are using local start command in order to start over again.

92
00:06:26,770 --> 00:06:33,720
Look I start this idea and here will be the name of the container in our case busy box one.

93
00:06:33,770 --> 00:06:44,460
It seems that I need to use only this AI option like so and now this container was started again.

94
00:06:44,460 --> 00:06:51,830
Let's go back to a second busy box and try again to busy box one and now it works again.

95
00:06:51,850 --> 00:06:52,740
What I did.

96
00:06:52,810 --> 00:06:56,410
I have actually arrest thought it contained the same container.

97
00:06:56,440 --> 00:07:04,740
Busy Box one with same IP address and same name music box one and now connectivity is restored.

98
00:07:04,900 --> 00:07:10,990
And that means that we are able to use this approach in order to create stable connectivity between

99
00:07:11,080 --> 00:07:14,160
different containers in the same custom network.

100
00:07:14,350 --> 00:07:20,940
And let's use this approach in order to create connectivity between BHP my admin container and my Eskil

101
00:07:20,940 --> 00:07:21,810
container.

102
00:07:21,950 --> 00:07:28,290
For now let's exit from all those containers exit from this one exit from this one as well.

103
00:07:28,570 --> 00:07:37,610
And let's remove all stop containers docker container prune yes and no we're good to go and we are ready

104
00:07:37,820 --> 00:07:42,660
to adjust so top of BHP my Edmond and my all containers.

105
00:07:42,680 --> 00:07:44,190
I'll see you just in a moment.

106
00:07:44,230 --> 00:07:44,500
My.

