1 00:00:00,000 --> 00:00:04,300 [Intro Music] 2 00:00:04,380 --> 00:00:06,330 We have just successfully pulled 3 00:00:06,360 --> 00:00:07,830 two different images from Docker 4 00:00:07,830 --> 00:00:09,690 Hub. And those images are 5 00:00:09,720 --> 00:00:11,940 hello-world and busybox. And 6 00:00:11,940 --> 00:00:13,140 basically now we are ready to 7 00:00:13,140 --> 00:00:15,180 create new containers from those 8 00:00:15,210 --> 00:00:17,730 images. But before doing that, let 9 00:00:17,730 --> 00:00:19,320 me explain you the structure of 10 00:00:19,320 --> 00:00:21,180 every image, and explain you 11 00:00:21,240 --> 00:00:23,460 actually key points about images. 12 00:00:24,450 --> 00:00:26,460 In a nutshell, every image is 13 00:00:26,490 --> 00:00:29,010 simply a set of files, that's that 14 00:00:29,010 --> 00:00:31,740 simple. And when you pull image 15 00:00:31,740 --> 00:00:33,810 from Remote Registry like Docker 16 00:00:33,810 --> 00:00:36,450 Hub, you download simply a set of 17 00:00:36,450 --> 00:00:38,730 files and folders, that's that simple. 18 00:00:39,930 --> 00:00:41,880 But every image is actually 19 00:00:41,880 --> 00:00:44,580 splitted into different file system 20 00:00:44,580 --> 00:00:48,630 layers, or shortly 'fs' layers. And 21 00:00:48,630 --> 00:00:50,250 you may ask me, what is the reason 22 00:00:50,280 --> 00:00:52,050 for splitting the images into 23 00:00:52,050 --> 00:00:55,470 multiple 'fs' layers? Answer is very 24 00:00:55,470 --> 00:00:57,990 simple, using such splitting 25 00:00:57,990 --> 00:01:01,080 approach, we are able to reuse 26 00:01:01,110 --> 00:01:03,000 different 'fs' layers in 27 00:01:03,030 --> 00:01:06,060 different images. For example, 28 00:01:06,209 --> 00:01:07,980 let's say that there is an image 29 00:01:08,010 --> 00:01:11,790 that has PHP installed in it. And 30 00:01:11,790 --> 00:01:13,890 now you want to create image that 31 00:01:13,890 --> 00:01:16,440 will be running WordPress. You 32 00:01:16,440 --> 00:01:18,330 probably know that WordPress uses 33 00:01:18,330 --> 00:01:21,210 PHP. And if you create wordpress 34 00:01:21,240 --> 00:01:24,810 image, you could reuse 'fs' layers in 35 00:01:24,810 --> 00:01:27,960 the 'php' image, and add additional 36 00:01:27,960 --> 00:01:30,390 layers that will install WordPress 37 00:01:30,390 --> 00:01:33,300 and run it afterwards. That's 38 00:01:33,330 --> 00:01:35,100 reusability of different 'fs' 39 00:01:35,100 --> 00:01:38,370 layers. Also, every image has so 40 00:01:38,370 --> 00:01:41,610 called Base Image. For example, 41 00:01:41,640 --> 00:01:44,190 Base Image could be busybox, or 42 00:01:44,190 --> 00:01:46,470 alpine, or ubuntu, or something 43 00:01:46,470 --> 00:01:49,842 else. And on top of that Base Image 44 00:01:49,842 --> 00:01:51,300 you are able to add 45 00:01:51,330 --> 00:01:52,950 additional layers like in this 46 00:01:52,950 --> 00:01:55,530 example, Layer 1, then on top of 47 00:01:55,530 --> 00:01:57,210 Layer 1 you add additional Layer 48 00:01:57,240 --> 00:01:59,040 2 image, and next you add 49 00:01:59,070 --> 00:02:01,620 additional Layer 3 image. And 50 00:02:01,620 --> 00:02:03,630 different images may have different 51 00:02:03,630 --> 00:02:06,540 quantity of the 'fs' layers. Some 52 00:02:06,570 --> 00:02:08,940 simple images may have just one or 53 00:02:08,940 --> 00:02:11,460 two 'fs' layers, more complicated 54 00:02:11,490 --> 00:02:13,380 images may have 10s of different 55 00:02:13,380 --> 00:02:16,140 layers. Alright, let me now talk 56 00:02:16,140 --> 00:02:18,150 about key points about Docker 57 00:02:18,150 --> 00:02:21,030 Image. First of all Docker Image is 58 00:02:21,060 --> 00:02:23,850 read-only. You are not able to 59 00:02:23,880 --> 00:02:26,430 modify existing Docker Image. It is 60 00:02:26,430 --> 00:02:29,040 not possible at all. But you are 61 00:02:29,040 --> 00:02:31,920 able to create custom image based 62 00:02:31,950 --> 00:02:35,850 on other image if you want. And if 63 00:02:35,880 --> 00:02:37,440 we'll get back to images that we 64 00:02:37,440 --> 00:02:39,060 have already pulled from Docker Hub 65 00:02:39,060 --> 00:02:41,070 hello-world and busybox, you are 66 00:02:41,070 --> 00:02:42,990 not able to modify those images. 67 00:02:43,710 --> 00:02:45,150 You are able just to create 68 00:02:45,150 --> 00:02:47,280 containers based on those images, 69 00:02:47,460 --> 00:02:49,590 or create other images based on 70 00:02:49,590 --> 00:02:52,590 those images. Next, as I have 71 00:02:52,590 --> 00:02:54,330 already told you every image 72 00:02:54,360 --> 00:02:56,760 consists of multiple file system 73 00:02:56,760 --> 00:03:00,930 layers. And there could be 1, 2, 3, 10s, 74 00:03:00,960 --> 00:03:02,880 100s of different 'fs' layers, 75 00:03:03,120 --> 00:03:05,670 as much as you want. Next, images 76 00:03:05,670 --> 00:03:07,470 could be stored in a private or 77 00:03:07,470 --> 00:03:10,020 public repositories. And we have 78 00:03:10,020 --> 00:03:11,730 actually used the public 79 00:03:11,730 --> 00:03:14,100 repositories for hello-world and 80 00:03:14,130 --> 00:03:15,960 busybox images. And those 81 00:03:15,960 --> 00:03:17,730 repositories are available at 82 00:03:17,760 --> 00:03:20,970 Docker Hub Public Registry. But 83 00:03:20,970 --> 00:03:23,100 you're also able to create private 84 00:03:23,100 --> 00:03:25,530 repositories if you create some 85 00:03:25,530 --> 00:03:27,780 proprietary images, and that your 86 00:03:27,780 --> 00:03:31,080 company only uses. Next, images could 87 00:03:31,080 --> 00:03:34,260 be copied, deleted or moved. And 88 00:03:34,260 --> 00:03:35,730 actually in the previous lecture, 89 00:03:35,820 --> 00:03:38,610 we have simply copied images from a 90 00:03:38,610 --> 00:03:40,650 remote server to our local 91 00:03:40,650 --> 00:03:42,930 computer. And in the same way, 92 00:03:42,990 --> 00:03:45,150 you're able to copy images from 93 00:03:45,150 --> 00:03:46,890 your computer and move it to other 94 00:03:46,890 --> 00:03:48,570 computer if you want to. Because 95 00:03:48,570 --> 00:03:50,760 every image again is simply a set 96 00:03:50,760 --> 00:03:53,490 of files. But during download 97 00:03:53,490 --> 00:03:55,530 process, you may have noticed that 98 00:03:55,650 --> 00:03:58,440 we were pulling different 'fs' layers. 99 00:03:59,070 --> 00:04:01,380 And actually when you pull image 100 00:04:01,380 --> 00:04:03,030 from a remote repository, from 101 00:04:03,030 --> 00:04:04,980 Remote Registry, then you are 102 00:04:04,980 --> 00:04:08,220 pulling archived 'fs' layers. And if 103 00:04:08,220 --> 00:04:10,140 for example, image has three 104 00:04:10,140 --> 00:04:11,850 different 'fs' layers, then you'll 105 00:04:11,850 --> 00:04:13,980 download three different archives. 106 00:04:14,490 --> 00:04:16,589 It is done for optimization of 107 00:04:16,589 --> 00:04:19,079 bandwidth usage. And afterwards on 108 00:04:19,079 --> 00:04:20,970 your local computer Docker will 109 00:04:21,000 --> 00:04:22,860 extract contents from those 110 00:04:22,860 --> 00:04:26,040 archives. Alright, next, you're 111 00:04:26,070 --> 00:04:28,530 able to use official or community 112 00:04:28,560 --> 00:04:30,870 images. And in the previous lecture 113 00:04:30,900 --> 00:04:33,480 hello-world and busybox images were 114 00:04:33,540 --> 00:04:36,480 official images. And if I go back 115 00:04:36,510 --> 00:04:38,490 to Docker Hub, here you will see 116 00:04:38,490 --> 00:04:40,770 that hello-world is Docker Official 117 00:04:40,770 --> 00:04:42,780 Image. But if I'll type for 118 00:04:42,780 --> 00:04:44,040 example, let's say, 119 00:04:44,910 --> 00:04:49,200 'php', you'll see that there is also 120 00:04:49,200 --> 00:04:52,140 php Official Image available; but 121 00:04:52,170 --> 00:04:55,110 if I scroll a bit down, you'll see 122 00:04:55,110 --> 00:04:57,750 such images as 'phpmyadmin/ 123 00:04:57,750 --> 00:05:01,590 phpmyadmin', 'phpdockerio/ 124 00:05:01,590 --> 00:05:05,850 php73-fpm'; and those images are 125 00:05:05,850 --> 00:05:08,100 community images. They were created 126 00:05:08,100 --> 00:05:11,010 by specific users. This image 127 00:05:11,040 --> 00:05:13,680 was created by 'phpmyadmin' user, 128 00:05:13,830 --> 00:05:16,890 this by 'phpdockerio' user, and so 129 00:05:16,890 --> 00:05:19,050 on. Again, there are official 130 00:05:19,050 --> 00:05:22,170 images and community images. You're of 131 00:05:22,170 --> 00:05:24,030 course able to use either 132 00:05:24,030 --> 00:05:26,220 official images or community images 133 00:05:26,340 --> 00:05:28,410 as long as they are publicly 134 00:05:28,410 --> 00:05:31,470 available. Alright, that's what I 135 00:05:31,470 --> 00:05:33,060 wanted to tell you about Docker 136 00:05:33,090 --> 00:05:35,640 Images. And the key point here is 137 00:05:35,640 --> 00:05:38,010 that every image is read-only, you 138 00:05:38,010 --> 00:05:39,810 are not able to modify the image. 139 00:05:40,320 --> 00:05:42,000 And the second key point is that 140 00:05:42,000 --> 00:05:44,400 every image consists of multiple 141 00:05:44,430 --> 00:05:47,400 file system layers. And every file 142 00:05:47,400 --> 00:05:49,380 system layer is simply a set of 143 00:05:49,380 --> 00:05:52,830 files and folders. Alright, that's 144 00:05:52,830 --> 00:05:55,110 all for image structure overview. 145 00:05:55,320 --> 00:05:57,420 And next, let's proceed and let's 146 00:05:57,420 --> 00:05:59,850 try to create first container based 147 00:05:59,880 --> 00:06:02,040 on hello-world image. I'll see you 148 00:06:02,040 --> 00:06:03,558 in the next lecture guys. Bye-Bye. 149 00:06:03,558 --> 00:06:05,994 [no audio]