1
00:00:04,300 --> 00:00:09,380
In the previous lecture, Echo explained what happened when we agreed that new.

2
00:00:09,450 --> 00:00:16,980
Hello World container from hello World Image and basically executable file called Hello was executed.

3
00:00:17,280 --> 00:00:21,450
And the responsibility of this file is simply to bring thanks to the terminal.

4
00:00:21,630 --> 00:00:22,140
That's it.

5
00:00:22,920 --> 00:00:25,050
And afterwards, container was stopped.

6
00:00:25,560 --> 00:00:33,620
Now, let me explain you what container actually is on this diagram you see in which layers here.

7
00:00:34,350 --> 00:00:40,590
And you already know that every image is read all live, all FSR layers in the image are read.

8
00:00:40,660 --> 00:00:46,980
Only you aren't able to modify them when you create a new container from a specific image.

9
00:00:47,790 --> 00:00:51,780
Dogor creates very small rya double layer.

10
00:00:52,910 --> 00:01:00,140
And you are able to read from that layer and right that layer create new files and folders and every

11
00:01:00,140 --> 00:01:03,300
container has its own rioter bill layer.

12
00:01:04,160 --> 00:01:09,950
In this example, there are two different containers, container, a container, a be created from the

13
00:01:10,040 --> 00:01:11,300
same image.

14
00:01:12,780 --> 00:01:13,570
Let me quickly do that.

15
00:01:13,620 --> 00:01:17,160
Actually, let me go to terminal and greet one more.

16
00:01:17,250 --> 00:01:17,910
Hello, Walter.

17
00:01:17,910 --> 00:01:18,510
Container.

18
00:01:18,740 --> 00:01:19,740
Dr. Ron.

19
00:01:20,700 --> 00:01:23,220
Hello, world and ISIS, same result.

20
00:01:23,730 --> 00:01:31,350
And if I and Dogra B as this eckermann now, I'll see that there are no two different stopped containers

21
00:01:31,860 --> 00:01:34,130
and those two different containers used.

22
00:01:34,230 --> 00:01:34,750
Same.

23
00:01:34,890 --> 00:01:37,140
Hello, Rolt image here and here.

24
00:01:38,410 --> 00:01:42,850
But the comment that was executed inside of avideo, those containers was the same.

25
00:01:43,300 --> 00:01:45,880
It was launch of the hello file.

26
00:01:47,280 --> 00:01:54,310
All right, let's proceed after creation of the container, Dogra actually loungers specific process

27
00:01:55,000 --> 00:01:57,070
specific brought us inside of the container.

28
00:01:57,940 --> 00:02:04,930
And as long as at least one process is ironic, inside of the container container is considered as a

29
00:02:04,930 --> 00:02:05,380
running.

30
00:02:06,490 --> 00:02:11,080
But as soon as protest ends, container is stopped.

31
00:02:12,060 --> 00:02:17,550
Let me explain you, all of this using an ARS or diagram on this diagram, dolus dogor host.

32
00:02:17,790 --> 00:02:19,140
It is Linux computer.

33
00:02:19,920 --> 00:02:24,540
There is dogor agent installed inside, also area Linux machine.

34
00:02:24,550 --> 00:02:30,030
It has a Linux kernel and cite your sources as C.P.U, RAM Network and Hard Drive.

35
00:02:30,690 --> 00:02:37,380
And let's suppose that we have already pulled some image from Dogor Hub here was this image located

36
00:02:37,650 --> 00:02:39,830
on the hard drive of this dogor host.

37
00:02:40,440 --> 00:02:43,820
And this image, let's assume, has two different afast layers.

38
00:02:44,290 --> 00:02:46,610
Image of one and image afast two.

39
00:02:47,760 --> 00:02:55,470
And again, those image Leros allocated on how dry up of this dogor host, when you enter Doka Iran,

40
00:02:55,860 --> 00:03:02,760
some image comment dogor will create additional rideable layer for new container.

41
00:03:02,970 --> 00:03:03,990
That is a first action.

42
00:03:04,770 --> 00:03:09,030
And this rideable layer will be created here on a hard drive of this.

43
00:03:09,090 --> 00:03:09,780
Dr. Holst.

44
00:03:11,710 --> 00:03:19,390
Next, you know that every image has instructions which are executed when new container is created.

45
00:03:19,810 --> 00:03:24,910
And in case with HelloWallet, in which this command was Iran, Kalloor executable file.

46
00:03:26,430 --> 00:03:35,040
And that means that you brought this on this Dr. Holst is created for particular new container like

47
00:03:35,040 --> 00:03:35,310
this.

48
00:03:36,440 --> 00:03:40,730
New protest is greeted, this process does some job.

49
00:03:42,370 --> 00:03:44,710
And afterwards, if this brought us arms.

50
00:03:45,900 --> 00:03:49,650
Dogor removes this container from memory.

51
00:03:50,690 --> 00:03:56,810
And in such case, when there are no protesters running inside of the container container, we'll be

52
00:03:56,810 --> 00:03:57,980
stopped by Dr..

53
00:03:59,370 --> 00:04:05,400
But those files rideable, the first layer for this container remains on the hard drive.

54
00:04:06,970 --> 00:04:14,740
But if you remove particular stopped container, then dogor, of course, removes this rideable first

55
00:04:14,740 --> 00:04:15,510
layer as well.

56
00:04:17,680 --> 00:04:24,550
It means that are able to greet multiple containers like so great container one with additional rideable

57
00:04:24,550 --> 00:04:25,200
the first layer.

58
00:04:26,310 --> 00:04:30,180
But notice that we don't need to create those layers.

59
00:04:31,200 --> 00:04:34,430
Because those layers are already present on hard drive.

60
00:04:35,130 --> 00:04:39,450
And this container will actually reuse those afast layers.

61
00:04:40,430 --> 00:04:44,870
Any processes running inside of this container will reuse those first layers.

62
00:04:45,620 --> 00:04:50,090
All right, rideable first layer was created, Broaddus was launched.

63
00:04:50,590 --> 00:04:56,600
And now let's suppose that this process is a long grinding brought us like database process or, for

64
00:04:56,600 --> 00:05:01,520
example, we execute some sweeps up or from some long ground actions and so on.

65
00:05:02,210 --> 00:05:07,160
And in such case, when Braudis is running, container is kept running.

66
00:05:07,490 --> 00:05:10,250
And Derris brought us in memory of this dogor Holst.

67
00:05:11,440 --> 00:05:18,750
And of course, Linux kernel manages all requests to resources like C.P.U Ramp Network from this process.

68
00:05:19,180 --> 00:05:21,910
All requests come via Linux kernel.

69
00:05:22,960 --> 00:05:27,640
Afterwards, when this container is running, let's suppose that you want to create new container using

70
00:05:27,640 --> 00:05:28,690
the same image.

71
00:05:29,700 --> 00:05:35,820
In such case, again, Dr. Creed's new rideable, the first layer, four new container.

72
00:05:37,030 --> 00:05:38,860
Those layers remain here.

73
00:05:39,310 --> 00:05:47,290
This container, too, will simply reuse those two first layers and next it creates new brought us for

74
00:05:47,380 --> 00:05:48,210
new container.

75
00:05:49,270 --> 00:05:55,660
And to gain this brought us communiques with resources like C.P.U, Rame Network and Hard Drive via

76
00:05:55,700 --> 00:06:02,560
common Linux Kernel Container 11 and they they to communicate by a common Linux kernel.

77
00:06:03,620 --> 00:06:06,170
But processes are completely independent.

78
00:06:06,320 --> 00:06:09,770
They are different, but ironic on the same Dr. Holst.

79
00:06:10,960 --> 00:06:11,350
All right.

80
00:06:11,780 --> 00:06:19,210
That's what happens when you create new containers based on a specific image and key point here is that

81
00:06:19,350 --> 00:06:25,330
our first layers of basic image that was used for creation of those containers are reused.

82
00:06:25,780 --> 00:06:28,180
They are not copied to any new container.

83
00:06:28,930 --> 00:06:32,140
Every new container gets just in you, right?

84
00:06:32,200 --> 00:06:33,190
Well, a first layer.

85
00:06:33,400 --> 00:06:34,050
That's it.

86
00:06:35,300 --> 00:06:39,440
And when brought this is stopped in specific container, dogor stops.

87
00:06:39,560 --> 00:06:40,670
Container as well.

88
00:06:41,060 --> 00:06:42,480
And removes it from memory.

89
00:06:43,100 --> 00:06:50,450
But the files of this container still remain on the hard drive until you enter doka our and command

90
00:06:50,690 --> 00:06:52,970
and remove specific stopped container.

91
00:06:53,540 --> 00:06:59,090
As you'll see from this diagram, Dogra utilize the resources of Dr. Holst very efficiently.

92
00:06:59,610 --> 00:07:02,630
Throws it reuses files on the hard drive.

93
00:07:03,200 --> 00:07:07,420
There is no need to copy file system leros from a specific image.

94
00:07:07,520 --> 00:07:09,410
When you create new containers.

95
00:07:10,350 --> 00:07:17,810
For every new container, dog agrees, just new arrival, a first layer all remaining underlying the

96
00:07:17,820 --> 00:07:20,550
first layers are reused from this image.

97
00:07:21,890 --> 00:07:25,070
And next, Dogor does not keep a container running.

98
00:07:25,370 --> 00:07:31,290
If there are no processes running inside the container, it immediately stops container.

99
00:07:31,730 --> 00:07:33,590
When there are no protesters running.

100
00:07:34,720 --> 00:07:35,150
All right.

101
00:07:35,450 --> 00:07:40,230
Let's not go to terminal and let's remove containers that we have created before.

102
00:07:40,610 --> 00:07:43,220
Basically, picture in our case is like this.

103
00:07:43,520 --> 00:07:45,140
There are no containers running.

104
00:07:45,440 --> 00:07:49,220
But there are still two containers on hard drive.

105
00:07:49,430 --> 00:07:51,140
But those containers are stopped.

106
00:07:51,700 --> 00:07:52,730
Let's go to a terminal.

107
00:07:53,150 --> 00:07:56,150
And here again, leased containers that we are stopped.

108
00:07:56,780 --> 00:07:58,310
There are no containers running.

109
00:07:59,480 --> 00:08:07,280
And now let's use dogor our command in order to remove stopped container and less forced to remove this

110
00:08:07,280 --> 00:08:07,820
container.

111
00:08:07,910 --> 00:08:13,790
Let's take its idea and let's remove it like so and let's remove second container.

112
00:08:13,970 --> 00:08:18,450
But let me use alternative version of this command docker container.

113
00:08:18,980 --> 00:08:26,330
Our M and you are also able to use randomly generated name in order to perform some actions with container.

114
00:08:26,570 --> 00:08:34,070
Let me copy this name and based here as argument for our AM command and second container was removed

115
00:08:34,100 --> 00:08:34,549
as well.

116
00:08:35,120 --> 00:08:39,740
And now there are no containers that are currently running or stopped.

117
00:08:40,900 --> 00:08:41,230
Great.

118
00:08:41,470 --> 00:08:45,820
But I still have image docker image just on the list.

119
00:08:46,240 --> 00:08:48,520
Hello, Walt, image and busy box image.

120
00:08:49,000 --> 00:08:50,920
It means that no picture is following.

121
00:08:51,310 --> 00:08:54,410
There are no our first layer of four containers.

122
00:08:54,970 --> 00:08:59,950
But there is still image on hard drive with correspondant first layers.

123
00:09:00,040 --> 00:09:02,290
Basically, there are two different images at the moment.

124
00:09:02,950 --> 00:09:09,190
And you are able, of course, remove images as well using Docker, my command.

125
00:09:09,670 --> 00:09:14,920
And here you could type or image I.D. or name of the image in order to remove it.

126
00:09:15,310 --> 00:09:17,230
Let's remove Beezy box image.

127
00:09:18,990 --> 00:09:20,830
Deleted and less or removed.

128
00:09:21,090 --> 00:09:21,650
Hello, Walt.

129
00:09:21,720 --> 00:09:23,640
Image, Kalloor, Rolt.

130
00:09:25,450 --> 00:09:27,540
A world in which was removed as well.

131
00:09:28,170 --> 00:09:32,420
And now if I'll have a look at least of images, I'll see amped at least.

132
00:09:33,050 --> 00:09:39,710
And that means that at the moment there are no images on hard drive on local dogor host.

133
00:09:40,230 --> 00:09:42,360
This whole picture looks like at the moment.

134
00:09:43,350 --> 00:09:45,600
All right, guys, I hope you enjoyed this lecture.

135
00:09:45,810 --> 00:09:52,200
And basically, that's all for this section where I made a small introduction into images and containers.

136
00:09:52,470 --> 00:09:56,340
And next, let me briefly summarize what we have covered in this section.

137
00:09:56,580 --> 00:09:57,360
I'll see you next.

138
00:09:57,480 --> 00:09:57,780
Bye bye.

