1
00:00:04,210 --> 00:00:09,260
Now you know what happens when you create new custom network and how to create new custom network.

2
00:00:09,370 --> 00:00:16,149
And you know that in the custom network we are able to assign custom names to containers and they use

3
00:00:16,210 --> 00:00:21,280
those names for communication and basically under the hood on our host.

4
00:00:21,280 --> 00:00:29,590
There is DNS cetera that resolves those custom names to IP addresses of the containers and beauty of

5
00:00:29,590 --> 00:00:35,320
this approach is that containers may have different dynamic IP addresses on different moments of time

6
00:00:35,680 --> 00:00:38,300
but names will be still the same.

7
00:00:38,440 --> 00:00:46,800
And Internal DNS cetera inside of the dock host will refresh those binding the hostname sorry name to

8
00:00:46,840 --> 00:00:49,820
IP address and resolve them correctly.

9
00:00:50,110 --> 00:00:56,010
And the week of verify that we were able to communicate between busy Books one and busy books to contain

10
00:00:56,020 --> 00:01:02,060
those even after a start of correspondence for example busy books one container.

11
00:01:02,090 --> 00:01:05,790
All right let's not proceed and no let's start over.

12
00:01:05,830 --> 00:01:08,910
B should be my admin and my SPL containers.

13
00:01:08,920 --> 00:01:15,570
But now in the cast on network recap that we have made a record of the commands that we have used for

14
00:01:15,640 --> 00:01:22,030
start of the Maya scale etc. and BHP my admin but those comments where I used to in the first example

15
00:01:22,060 --> 00:01:24,730
let me add here is description.

16
00:01:24,730 --> 00:01:32,010
Example one where we have created those two containers in default breach network.

17
00:01:32,050 --> 00:01:33,450
Let me add here to this creeps.

18
00:01:33,490 --> 00:01:40,010
Example one default breach Network.

19
00:01:40,360 --> 00:01:40,990
Great.

20
00:01:40,990 --> 00:01:43,010
Let me know copied this entire section.

21
00:01:43,150 --> 00:01:49,260
And in the same file commands the disks deep regret that this file is located in that Maya scale folder

22
00:01:49,270 --> 00:01:51,640
here in our containers folder.

23
00:01:51,640 --> 00:02:00,010
Let me copied this section and pasted here below like so and here will be an example too and we'll be

24
00:02:00,010 --> 00:02:00,700
here.

25
00:02:00,890 --> 00:02:08,110
Custom breach network and first of all of course we need to create a new custom network or we're able

26
00:02:08,110 --> 00:02:14,050
to reuse the custom network that we have created before but for the sake of this example let's create

27
00:02:14,140 --> 00:02:21,430
one more custom breach network and let's name it let's say my skill and he'll let me at this command

28
00:02:22,460 --> 00:02:30,580
dock our network create and name will be Maya Skrill and that's it and his description of this command

29
00:02:31,480 --> 00:02:37,070
create a custom breach network right.

30
00:02:37,440 --> 00:02:44,920
And now we are able to use name of this custom network in those commands and we will run my Skrill and

31
00:02:44,950 --> 00:02:52,420
BHP my admin containers in this custom Maya Skrill network and he let me add new line your step and

32
00:02:52,480 --> 00:02:58,590
add additional option does dash network and here will be name of new network my scale.

33
00:02:58,660 --> 00:03:04,120
And don't forget to add here backslash because we have split it the long command into multiple lines

34
00:03:04,600 --> 00:03:06,780
and remaining part will be the same.

35
00:03:06,820 --> 00:03:14,170
And basically let's also add the dash de option in order to start my s go container in by ground we

36
00:03:14,170 --> 00:03:19,660
actually don't need to see logs and if you need to do so you are always able to use Docker locks command

37
00:03:19,860 --> 00:03:27,000
with a D or name of corresponding container you want to read logs from great we have adjusted this throws

38
00:03:27,030 --> 00:03:33,970
the command and let's also adjust to this second command that will run BHP my admin and here we'll be

39
00:03:33,970 --> 00:03:44,270
communication over DNS name instead of address and actually DNS name will be name of the container.

40
00:03:44,400 --> 00:03:45,900
Let me add this information here.

41
00:03:45,900 --> 00:03:47,340
Name of the container.

42
00:03:48,600 --> 00:03:55,110
Let me use option or I'll zip combination in order to make this long line visible here on the screen

43
00:03:55,470 --> 00:04:03,360
and let me I just have this command dock Iran backslash and here we'll be on there's dish network my

44
00:04:03,380 --> 00:04:09,990
scale again same network those two containers will be attached to the same network and also let me add

45
00:04:09,990 --> 00:04:17,190
here that's the option and I'll run this container also in background all right we have placed those

46
00:04:17,190 --> 00:04:21,640
two containers into the cost of network called Maya scale here and here.

47
00:04:22,019 --> 00:04:29,350
But now most important part we need to adjust this set and we now want to communicate with my skill

48
00:04:29,370 --> 00:04:36,420
container using its name actually DNS name and that's actually the reason why we have to create that

49
00:04:36,420 --> 00:04:40,330
new custom network and we have adjusted this example number one.

50
00:04:40,350 --> 00:04:40,920
All right.

51
00:04:41,070 --> 00:04:48,210
Now we want to use hostname on name of the Maya scale container instead of this IP address let me removed

52
00:04:48,210 --> 00:04:55,830
as they gathered from here and type my Eskil but now we need to set off a custom name for this Maya

53
00:04:55,880 --> 00:05:02,160
circular container because we sites set up it will get randomly assigned name and that's not what we

54
00:05:02,160 --> 00:05:08,330
want to help and remember that we'll be able to communicate with this container if it will go on in

55
00:05:08,610 --> 00:05:10,980
with custom name it's not possible.

56
00:05:11,080 --> 00:05:11,520
Okay.

57
00:05:11,730 --> 00:05:19,170
Let's add one more option here and it will name look me it here there's this name and name will be my

58
00:05:19,320 --> 00:05:20,160
Skrill.

59
00:05:20,220 --> 00:05:27,550
And don't forget to add backslash like this and now we have actually created fully rocking configuration.

60
00:05:27,750 --> 00:05:31,160
Here is the command for start of the Maya skill Sara.

61
00:05:31,290 --> 00:05:35,370
And is command for a start of the BHP at my end container.

62
00:05:35,370 --> 00:05:36,130
Wonderful.

63
00:05:36,150 --> 00:05:42,380
Let's note does this set up and let's first create new custom network gold Maya scale.

64
00:05:42,390 --> 00:05:43,950
Let me copy simply this comment.

65
00:05:44,280 --> 00:05:50,100
Basically you are able to find this commands in GitHub repository for the scrolls but I recommend you

66
00:05:50,100 --> 00:05:56,220
to grade those commands manually along with me in such a way you'll learn much much more and much much

67
00:05:56,220 --> 00:05:57,090
better.

68
00:05:57,090 --> 00:05:57,450
Great.

69
00:05:57,450 --> 00:06:04,290
Let me a copy this comment gold two time and no A.L. let's create first Newcastle network Docker network

70
00:06:04,290 --> 00:06:15,610
create my Eskil network was created and let's inspect it first Docker network inspect my scale and here

71
00:06:15,610 --> 00:06:17,740
are the details about this custom network.

72
00:06:17,770 --> 00:06:24,530
Notice that the here is new subnet that was assigned to this custom network it is maxed subnet off the

73
00:06:24,520 --> 00:06:30,610
previous one that was used for cost of network we have created before them and here is new gateway that

74
00:06:30,610 --> 00:06:39,240
was actually created at the docker host please note that if you are working on Mac or Windows this IP

75
00:06:39,240 --> 00:06:45,220
address is created inside of the viewer doll machine that is running on macros or windows.

76
00:06:45,460 --> 00:06:52,210
And if I'll have a look at the if config on my Mac now if convicted I You will not see such a bother

77
00:06:52,210 --> 00:06:53,590
us here on the list.

78
00:06:53,610 --> 00:06:58,660
I will still see only as a net zero interface and low back zero interface.

79
00:06:58,660 --> 00:06:59,410
Sorry.

80
00:06:59,410 --> 00:07:00,620
Here it is.

81
00:07:00,640 --> 00:07:06,720
So here is a back and here is as I'm net zero with such IP address assigned to eat.

82
00:07:06,910 --> 00:07:15,430
There are no addresses from those ranges eyes or this range that we see here or a nasal Ranger's assigned

83
00:07:15,430 --> 00:07:21,490
to Oz or breach networks because those breach networks are created inside of the docker host.

84
00:07:21,490 --> 00:07:24,670
Again it relates only to Mac OS and Windows.

85
00:07:24,670 --> 00:07:30,850
If you are running the doc or direct on Linux you will see those new interfaces created directly on

86
00:07:30,940 --> 00:07:32,320
your computer.

87
00:07:32,320 --> 00:07:32,700
Great.

88
00:07:32,710 --> 00:07:33,680
Let me proceed.

89
00:07:33,700 --> 00:07:36,730
And now we are ready to create two new containers.

90
00:07:36,730 --> 00:07:38,540
Let me go to our comments here.

91
00:07:38,620 --> 00:07:42,920
Let me copy this comment that will create my skill container.

92
00:07:42,970 --> 00:07:44,240
Let me copy it.

93
00:07:44,260 --> 00:07:48,600
Go to terminal and paste here like so and press enter.

94
00:07:48,610 --> 00:07:54,850
Notice that we will still use an environment variable that will set the Maya scale root password and

95
00:07:54,850 --> 00:07:56,730
the two will be equal to my password.

96
00:07:56,740 --> 00:07:57,150
Great.

97
00:07:57,160 --> 00:08:01,620
Lets presenter and I see here a d of the container.

98
00:08:01,820 --> 00:08:04,820
Let's verify a way as it does a running or not dogger appears.

99
00:08:05,400 --> 00:08:06,830
And yes now it is up.

100
00:08:06,870 --> 00:08:08,100
It's a good sign.

101
00:08:08,100 --> 00:08:14,730
Let's not go back to visual studio gold and he'll just copy this comment book Iran and this comment

102
00:08:14,760 --> 00:08:18,120
will create the additional container with BHP.

103
00:08:18,150 --> 00:08:20,170
My admin image.

104
00:08:20,270 --> 00:08:22,740
Let's copy it and then go by here.

105
00:08:22,740 --> 00:08:28,000
Based anthro and I see a D of second container.

106
00:08:28,060 --> 00:08:36,240
Let's now have a look at the docker the result and now I see two containers running here with BHP my

107
00:08:36,350 --> 00:08:39,520
me image that was used for this container and here I see it.

108
00:08:39,559 --> 00:08:43,750
Maya scale you mentioned it was used for this second image and noticed that.

109
00:08:43,830 --> 00:08:50,550
Here you'll see custom name for this Maya scale image but there is still a random name assigned to this.

110
00:08:50,560 --> 00:08:57,060
BHP my editing image and the reason for that is that we will not actually require communication from

111
00:08:57,060 --> 00:08:59,290
Maya Skrill to BHP my Edmund.

112
00:08:59,310 --> 00:09:04,410
That's why we haven't assigned custom name to this BHP my Edmond container but basically if you want

113
00:09:04,410 --> 00:09:11,040
to keep it running and get back to it later on it's a good practice to assign custom name actually to

114
00:09:11,040 --> 00:09:12,210
it as well.

115
00:09:12,210 --> 00:09:18,420
All right let's now open up a web browser because we have created port mapping here what is and verify

116
00:09:18,480 --> 00:09:25,070
whether we will be able to connect to BHP my admin and establish connection to my school container.

117
00:09:25,440 --> 00:09:26,490
Let's try it.

118
00:09:26,550 --> 00:09:30,490
Let's go to Google Chrome and actually I see this page still opened here.

119
00:09:30,810 --> 00:09:34,850
Let's remove this part and let us enter a refresh page.

120
00:09:34,860 --> 00:09:36,550
Welcome to BHP my admin.

121
00:09:36,690 --> 00:09:39,750
Again this container is a brand new container.

122
00:09:39,750 --> 00:09:43,080
It differs from the container it was running before.

123
00:09:43,080 --> 00:09:46,930
All right here will be a user name for my high school database.

124
00:09:46,950 --> 00:09:50,980
And here will be a password recap the password is a here.

125
00:09:51,000 --> 00:09:56,050
Let me scroll up here was my password that we have set in this environment variable.

126
00:09:56,070 --> 00:10:07,460
Let's go back to Google Chrome and here type my password click go and I am in and that means that communication

127
00:10:07,490 --> 00:10:13,580
between BHP be my Edmond container and my Skrill was established successfully.

128
00:10:14,390 --> 00:10:19,340
And that is the most important outcome from the previous and this lecture.

129
00:10:19,340 --> 00:10:24,750
It was a long story and I explained you how to create custom bridge networks.

130
00:10:24,920 --> 00:10:26,450
What is an environment variable.

131
00:10:26,450 --> 00:10:30,410
How are you able to communicate in customer network using customer names.

132
00:10:30,410 --> 00:10:36,680
And finally we can gather all those pieces together and we have launched those two containers.

133
00:10:36,680 --> 00:10:44,760
BHP my admin and my school container now it's a good time to proceed and the next the let's lounge.

134
00:10:44,760 --> 00:10:51,750
One more container in this network in this my Skrill costal network and basically you are ready to get

135
00:10:51,750 --> 00:10:55,730
the challenge and you will need to create this custom container.

136
00:10:55,740 --> 00:10:58,400
It will be at what press container yourself.

137
00:10:58,440 --> 00:11:00,030
Challenge task comes next.

138
00:11:00,030 --> 00:11:05,550
It will be pretty simple and I am sure you will be able to complete yourself without any additional

139
00:11:05,550 --> 00:11:06,640
help.

140
00:11:06,660 --> 00:11:07,710
All right see you next.

141
00:11:07,710 --> 00:11:08,030
Bye bye.

