1
00:00:04,200 --> 00:00:10,290
We have just successfully pulled two different images from Docker Hub, and those images are Hello World

2
00:00:10,290 --> 00:00:11,390
and BusyBox.

3
00:00:11,400 --> 00:00:15,960
And basically now we are ready to create new containers from those images.

4
00:00:16,140 --> 00:00:22,320
But before doing that, let me explain you structure of every image and explain you actually key points

5
00:00:22,320 --> 00:00:25,320
about images in a nutshell.

6
00:00:25,350 --> 00:00:28,390
Every image is simply a set of files.

7
00:00:28,410 --> 00:00:29,730
That's the simple.

8
00:00:29,970 --> 00:00:36,990
And when you pull image from remote registry like Docker Hub, you download simply a set of files and

9
00:00:36,990 --> 00:00:37,590
folders.

10
00:00:37,590 --> 00:00:38,820
That's the simple.

11
00:00:39,750 --> 00:00:47,610
But every image is actually splitted into different file system layers or shortly layers.

12
00:00:48,120 --> 00:00:53,730
And you may ask me what is the reason for splitting images into multiple layers?

13
00:00:54,540 --> 00:00:56,270
Answer is very simple.

14
00:00:56,280 --> 00:01:04,290
Using such splitting approach, we are able to reuse different layers in different images.

15
00:01:05,099 --> 00:01:13,020
For example, let's say that there is an image that has PHP installed in it and now you want to create

16
00:01:13,050 --> 00:01:15,510
image that will be running WordPress.

17
00:01:15,900 --> 00:01:24,480
You probably know that WordPress uses PHP and if you create WordPress image, you could reuse layers

18
00:01:24,480 --> 00:01:31,650
in the PHP image and add additional layers that will install WordPress and run it afterwards.

19
00:01:32,790 --> 00:01:35,790
That's reusability of different layers.

20
00:01:36,030 --> 00:01:40,020
Also, every image has so-called base image.

21
00:01:40,640 --> 00:01:47,000
For example, base image could be BusyBox or Alpine or Ubuntu or Samsung Girls.

22
00:01:47,330 --> 00:01:54,510
And on top of that base image you are able to add additional layers like in this example layer one.

23
00:01:54,530 --> 00:01:59,840
Then on top of layer one, you add additional layer two image and next you will add additional layer

24
00:01:59,840 --> 00:02:05,570
three image and different images may have different quantity of layers.

25
00:02:05,840 --> 00:02:10,130
Some simple images may have just 1 or 2 layers.

26
00:02:10,340 --> 00:02:14,030
More complicated images may have tens of different layers.

27
00:02:14,540 --> 00:02:15,320
All right.

28
00:02:15,320 --> 00:02:18,690
Let me now talk about key points about Docker image.

29
00:02:18,710 --> 00:02:22,070
First of all, Docker image is read only.

30
00:02:22,460 --> 00:02:26,090
You are not able to modify existing Docker image.

31
00:02:26,090 --> 00:02:27,620
It is not possible at all.

32
00:02:28,040 --> 00:02:33,350
But you are able to create custom image based on other image.

33
00:02:33,410 --> 00:02:34,520
If you want.

34
00:02:34,670 --> 00:02:40,620
And if we will get back to images that we have already pulled from Docker Hub, Hello World and BusyBox,

35
00:02:40,620 --> 00:02:43,170
you are not able to modify those images.

36
00:02:43,530 --> 00:02:50,580
You are able just to create containers based on those images or create other images based on those images.

37
00:02:51,180 --> 00:02:51,930
Next.

38
00:02:51,930 --> 00:02:58,860
As I have already told you, every image consists of multiple file system layers and there could be

39
00:02:58,860 --> 00:03:04,230
one, two, three tens, hundreds of different layers as much as you want.

40
00:03:04,260 --> 00:03:11,700
Next images could be stored in a private or public repositories, and we have actually used the public

41
00:03:11,700 --> 00:03:19,080
repositories for Helloworld and BusyBox images and those repositories are available at Docker Hub Public

42
00:03:19,080 --> 00:03:19,950
Registry.

43
00:03:20,430 --> 00:03:27,480
But you are also able to create private repositories if you create some proprietary images and that

44
00:03:27,480 --> 00:03:33,450
your company only uses next images could be copied, deleted or moved.

45
00:03:33,690 --> 00:03:41,430
And actually in the previous lecture we have simply copied images from remote server to our local computer.

46
00:03:41,640 --> 00:03:47,370
And in the same way you are able to copy images from your computer and move it to other computer if

47
00:03:47,370 --> 00:03:48,030
you want to.

48
00:03:48,030 --> 00:03:51,670
Because every image, again, is simply a set of files.

49
00:03:52,120 --> 00:03:59,860
But during download process you may have noticed that we were pulling different layers and actually

50
00:03:59,860 --> 00:04:07,630
when you pull image from remote repository from remote registry, then you are pulling archived layers.

51
00:04:07,630 --> 00:04:14,230
And if for example, image has three different layers, then you'll download three different archives.

52
00:04:14,320 --> 00:04:21,700
It is done for optimization of bandwidth usage and afterwards on your local computer, Docker will extract

53
00:04:21,700 --> 00:04:23,710
contents from those archives.

54
00:04:24,450 --> 00:04:25,080
All right.

55
00:04:25,110 --> 00:04:29,280
Next, you are able to use official or community images.

56
00:04:29,280 --> 00:04:34,800
And in the previous lecture, Hello World and BusyBox images were official images.

57
00:04:34,800 --> 00:04:41,400
And if I'll go back to Docker Hub here, you'll see that Hello world is Docker official image.

58
00:04:41,400 --> 00:04:45,360
But if I'll type, for example, let's say PHP.

59
00:04:47,360 --> 00:04:51,650
You'll see that there is also a PHP official image available.

60
00:04:51,650 --> 00:05:00,700
But if I'll scroll a bit down, you'll see such images as phpMyAdmin slash, phpmyadmin, php, docker

61
00:05:00,710 --> 00:05:07,010
IO slash PHP 73 FPM and those images are community images.

62
00:05:07,010 --> 00:05:09,980
They were created by specific users.

63
00:05:10,100 --> 00:05:17,300
This image was created by phpMyAdmin user, this by PHP, docker user, and so on.

64
00:05:17,720 --> 00:05:21,200
Again, there are official images and community images.

65
00:05:21,530 --> 00:05:29,120
You of course able to use either official images or community images as long as they are publicly available.

66
00:05:29,690 --> 00:05:30,500
All right.

67
00:05:30,500 --> 00:05:33,680
That's what I wanted to tell you about Docker images.

68
00:05:33,680 --> 00:05:39,920
And key point here is that every image is read only you are not able to modify image.

69
00:05:40,040 --> 00:05:47,760
And second key point is that every image consists of multiple file system layers and every file system

70
00:05:47,760 --> 00:05:50,610
layer is simply a set of files and folders.

71
00:05:51,630 --> 00:05:52,350
All right.

72
00:05:52,350 --> 00:05:55,110
That's all for image structure overview.

73
00:05:55,110 --> 00:06:01,440
And next, let's proceed and let's try to create first container based on Hello World image.

74
00:06:01,510 --> 00:06:03,000
I'll see you in the next lecture, guys.

75
00:06:03,000 --> 00:06:03,570
Bye bye.

