1 00:00:00,000 --> 00:00:04,600 [Intro Music] 2 00:00:04,620 --> 00:00:06,000 In the previous lecture, we have 3 00:00:06,000 --> 00:00:07,470 successfully created a new 4 00:00:07,470 --> 00:00:09,690 container based on hello-world 5 00:00:09,720 --> 00:00:12,390 image, and we have seen such output 6 00:00:12,390 --> 00:00:14,460 in the terminal. Now, let me 7 00:00:14,460 --> 00:00:16,290 explain you what actually happened 8 00:00:16,290 --> 00:00:18,450 under the hood; and why this 9 00:00:18,450 --> 00:00:20,460 container has printed this text to 10 00:00:20,460 --> 00:00:22,680 the terminal. Let me show you one 11 00:00:22,680 --> 00:00:25,380 more diagram with image example. I 12 00:00:25,380 --> 00:00:27,240 have told you that every image is 13 00:00:27,270 --> 00:00:29,340 simply a set of different 'FS' 14 00:00:29,370 --> 00:00:32,369 layers. In one of those layers, 15 00:00:32,460 --> 00:00:34,800 there are instructions, text 16 00:00:34,800 --> 00:00:37,320 instructions, which tells Docker 17 00:00:37,500 --> 00:00:39,420 what it needs to do when a new 18 00:00:39,420 --> 00:00:41,250 container is created based on a 19 00:00:41,250 --> 00:00:44,550 specific image. For example, let's 20 00:00:44,550 --> 00:00:46,890 have a look at this image. In this 21 00:00:46,920 --> 00:00:49,290 image, there are several FS layers. 22 00:00:50,430 --> 00:00:53,280 Base Image is Ubuntu. In the next 23 00:00:53,280 --> 00:00:55,140 layer, there is an Application 24 00:00:55,170 --> 00:00:57,330 that was installed in separate FS 25 00:00:57,330 --> 00:00:59,820 layer. And for example, there is 26 00:00:59,850 --> 00:01:03,030 WordPress application. And finally, 27 00:01:03,090 --> 00:01:05,879 there is additional FS layer with 28 00:01:05,910 --> 00:01:08,850 some text, with some command that 29 00:01:08,880 --> 00:01:11,340 tells what container needs to do 30 00:01:11,550 --> 00:01:14,910 when it is created. An example of 31 00:01:14,910 --> 00:01:16,440 the command in this particular 32 00:01:16,470 --> 00:01:19,470 image is, 'start wordpress process'. 33 00:01:20,490 --> 00:01:22,260 Of course, this command is in human 34 00:01:22,260 --> 00:01:24,030 words, but under the hood it will 35 00:01:24,030 --> 00:01:26,280 be different. But again, idea is 36 00:01:26,280 --> 00:01:28,020 that there is a specific command 37 00:01:28,470 --> 00:01:31,050 that tells what to do, which 38 00:01:31,050 --> 00:01:33,210 process to start when new container 39 00:01:33,240 --> 00:01:36,600 is created. And in this example, 40 00:01:36,690 --> 00:01:38,280 when we have started hello-world 41 00:01:38,280 --> 00:01:40,980 container, there was an instruction 42 00:01:41,700 --> 00:01:44,340 to run a specific executable file 43 00:01:44,580 --> 00:01:46,410 that prints text to the terminal. 44 00:01:46,800 --> 00:01:49,020 That's it. And I could actually 45 00:01:49,020 --> 00:01:51,660 quickly show you where is this file 46 00:01:51,720 --> 00:01:53,970 inside of the container. For that I 47 00:01:53,970 --> 00:01:56,670 could enter 'docker inspect' command. 48 00:01:56,940 --> 00:01:59,070 Actually, I need to enter 'docker ps 49 00:01:59,100 --> 00:02:01,080 -a' first in order to find out 50 00:02:01,110 --> 00:02:03,240 ID of the container. No worries, we 51 00:02:03,240 --> 00:02:05,460 will talk about ID a bit later. And 52 00:02:05,460 --> 00:02:08,520 next type, 'docker inspect'; and 53 00:02:08,520 --> 00:02:10,560 copy this ID from here like 54 00:02:10,560 --> 00:02:14,370 this. And let me scroll up a bit. 55 00:02:15,480 --> 00:02:18,120 And here you could find 'Cmd' 56 00:02:18,330 --> 00:02:21,450 instruction; and in this container 57 00:02:21,720 --> 00:02:25,020 'hello' file was executed. It is 58 00:02:25,020 --> 00:02:28,170 basically Linux executable file and 59 00:02:28,170 --> 00:02:31,140 it's goal, just simply print such 60 00:02:31,140 --> 00:02:32,910 text to the terminal. That's it. 61 00:02:33,960 --> 00:02:37,110 Alright, but what is container, and 62 00:02:37,140 --> 00:02:39,060 what you're able to do inside of 63 00:02:39,060 --> 00:02:41,130 the container? Let me answer this 64 00:02:41,130 --> 00:02:43,400 question in the next lecture. See you there. 65 00:02:43,400 --> 00:02:45,973 [no audio]