1
00:00:04,730 --> 00:00:10,380
We just graft at such Docker file with different instructions like World Deal, Export, Scorpion,

2
00:00:10,410 --> 00:00:10,880
so on.

3
00:00:11,210 --> 00:00:16,400
And now it's time to build our cast on Docker image using this Docker file.

4
00:00:17,180 --> 00:00:21,210
In total, there are eight instructions, but you only build Broaddus.

5
00:00:21,290 --> 00:00:25,760
You'll see that Docker will actually run seven different steps.

6
00:00:26,150 --> 00:00:35,000
And such last step where we used a CMG instruction will be executed only when container based on such

7
00:00:35,000 --> 00:00:36,740
image will be started this way.

8
00:00:36,770 --> 00:00:41,030
There was no need to ram, it seemed when actual build products will be running.

9
00:00:41,510 --> 00:00:44,840
It means that it will stop after a big amount this one.

10
00:00:45,380 --> 00:00:45,800
All right.

11
00:00:46,190 --> 00:00:48,680
Let's now build this custom Docker image.

12
00:00:48,680 --> 00:00:52,490
And for that, let's go to the terminal in order to have more space here.

13
00:00:52,820 --> 00:00:56,960
And now let's see Defroster two API folder.

14
00:00:57,260 --> 00:01:01,520
Let's see the two desktop images gallery in my case API.

15
00:01:01,730 --> 00:01:04,700
Make sure that the U.S. API folder as well.

16
00:01:04,879 --> 00:01:11,540
And here, if I at least files and folders, I'll find doggerel file and no inside of these directory,

17
00:01:11,540 --> 00:01:19,100
please enter on command Docker Build Dot Dot as usually represents current working directory and it

18
00:01:19,100 --> 00:01:26,180
is API folder and Docker will attempt to find Docker file inside of this directory.

19
00:01:26,570 --> 00:01:31,730
Of course, if you want, you could use here and also file, for instance, Relative Path Desktop Image

20
00:01:31,850 --> 00:01:33,170
Gallery API.

21
00:01:33,200 --> 00:01:37,150
This will also work what is already inside of the e-Bay folder.

22
00:01:37,160 --> 00:01:38,980
It makes sense to use just dot.

23
00:01:39,650 --> 00:01:40,070
All right.

24
00:01:40,340 --> 00:01:45,410
Let's now run, build process and see step by step what Docker will do.

25
00:01:46,280 --> 00:01:46,790
Run.

26
00:01:47,920 --> 00:01:54,010
Throws it to laws build definition from Docker file, it means Docker file was found next.

27
00:01:54,040 --> 00:02:01,180
It starts with step number one with instruction from and it downloads by it, an image from the Docker

28
00:02:01,180 --> 00:02:01,570
hub.

29
00:02:01,870 --> 00:02:04,360
And here with exact stack 3.9.

30
00:02:05,200 --> 00:02:08,139
This image consists of multiple layers of this way.

31
00:02:08,139 --> 00:02:11,800
Here you'll see that the different layers are downloaded here.

32
00:02:12,040 --> 00:02:13,980
Here, for instance here.

33
00:02:15,160 --> 00:02:18,190
Here was a large layer, this 50 megabytes.

34
00:02:19,230 --> 00:02:22,240
Let's wait a bit until those letters are downloaded.

35
00:02:24,220 --> 00:02:30,340
After the Lord, the doctor extracts the contents of corresponding layers, for instance, here you

36
00:02:30,340 --> 00:02:35,050
see extract operation, all next steps doctor will complete much faster.

37
00:02:35,230 --> 00:02:39,130
It just needs time to download all those layers from Docker hub.

38
00:02:40,560 --> 00:02:45,710
Docker just greeted the working directory, a step number two, and on step number three, Docker has

39
00:02:45,720 --> 00:02:51,260
corporate the AP file and baby file, but look into that newly created working directory.

40
00:02:51,690 --> 00:02:53,430
Hop on the next step.

41
00:02:53,430 --> 00:02:57,030
Step number four Docker ranks command baby installer.

42
00:02:58,380 --> 00:03:03,060
And here on this step, using baby, we installed the API and we package.

43
00:03:03,930 --> 00:03:10,170
This package is used on the next step step number five in order to generate list of all requirements

44
00:03:10,560 --> 00:03:13,680
and socialist is stored in the file requirements.

45
00:03:13,680 --> 00:03:14,140
But the.

46
00:03:15,600 --> 00:03:22,500
This file was created and the next step, step number six, we ran one more comment and we install all

47
00:03:22,500 --> 00:03:26,670
requirements listed in the requirements to file using paper.

48
00:03:27,330 --> 00:03:31,530
And finally, all remaining files located in the API folder.

49
00:03:31,830 --> 00:03:39,330
Our project files are copied to the destination working directory, less up inside of the image and

50
00:03:39,330 --> 00:03:46,380
after step number seven Docker finishes creation of the Docker image and it exports it to the image.

51
00:03:47,040 --> 00:03:54,630
Here you see that it exposed different layers and basically Docker has created separate layers for each

52
00:03:54,630 --> 00:03:55,650
build step.

53
00:03:55,860 --> 00:04:02,190
Here, here or here, for instance, and later on, if you need to perform attribute of the same image,

54
00:04:02,460 --> 00:04:07,120
Docker might reuse same layers as we're already created before.

55
00:04:07,140 --> 00:04:11,460
For instance, this layer and we will have a look at that a bit later in this course.

56
00:04:12,120 --> 00:04:16,260
Finally, Docker has redone image with such success.

57
00:04:16,500 --> 00:04:20,940
Here it is, and now we have access to this newly created image.

58
00:04:21,480 --> 00:04:26,610
And now let's have a look at the list of the images that are available for use locally on your computer.

59
00:04:26,820 --> 00:04:31,950
Using command Docker images and now you should see two different images.

60
00:04:32,370 --> 00:04:33,870
One is called Hello World.

61
00:04:34,080 --> 00:04:38,100
It is name of the repository and another name is none.

62
00:04:38,730 --> 00:04:42,810
And this that image that we just built here was if has.

63
00:04:43,840 --> 00:04:50,500
This custom in which doesn't have any repository name and doesn't have any tech because we didn't specify

64
00:04:50,500 --> 00:04:57,580
them, but I see that such image was created several minutes ago and the size is almost one gigabyte

65
00:04:58,210 --> 00:05:04,270
size of this image is relatively large, and Doka rolled because we actually used a large base image

66
00:05:04,420 --> 00:05:05,620
that the sculpt python.

67
00:05:05,920 --> 00:05:13,420
This one, I decided to select this base image for our API project because it has all necessary dependencies

68
00:05:13,420 --> 00:05:16,300
inside and we will be able to run smoothly.

69
00:05:16,510 --> 00:05:19,930
Python Flask application of here using this base image.

70
00:05:20,830 --> 00:05:26,380
Also, you might find a repository called Helloworld and this data repository that we downloaded before

71
00:05:26,530 --> 00:05:29,560
when we executed Commando Carawan a rolled.

72
00:05:29,770 --> 00:05:34,330
That is the most simple and the most the smallest and bailable image Addo-Carr.

73
00:05:34,750 --> 00:05:37,180
And its size is just 13 gigabyte.

74
00:05:37,840 --> 00:05:44,830
All right now, we are actually able to create new container based on this image using image i.d.s.

75
00:05:45,460 --> 00:05:48,630
But honestly, I don't like using IDs of the images.

76
00:05:48,640 --> 00:05:50,620
It is not convenient this way.

77
00:05:50,650 --> 00:05:56,710
Let's quickly rebuild this image and add to it a repository name, and let's name it.

78
00:05:56,720 --> 00:06:00,700
For instance, images gallery API, and we will look at any tech.

79
00:06:00,700 --> 00:06:03,790
In such case, Docker will automatically adtech latest.

80
00:06:04,210 --> 00:06:10,320
All right, let's rebuild our image and you'll see that no build process will go much, much faster.

81
00:06:10,330 --> 00:06:11,920
It will take just several seconds.

82
00:06:12,460 --> 00:06:15,220
We will use same comment as before Docker build.

83
00:06:15,610 --> 00:06:19,600
Dot Dot represents current directory and afterwords.

84
00:06:19,600 --> 00:06:26,050
Lets that image using option DST and here will be repository name images.

85
00:06:26,080 --> 00:06:32,440
This gallery, this API you could choose, of course, any name you want, but I recommend to you to

86
00:06:32,440 --> 00:06:33,910
just mean the full names.

87
00:06:34,480 --> 00:06:34,860
All right.

88
00:06:35,210 --> 00:06:40,900
Here, after calling, you are also able to specify attack, but I will keep this part empty.

89
00:06:40,900 --> 00:06:42,790
In such case, Docker will attack.

90
00:06:42,790 --> 00:06:43,420
Latest.

91
00:06:43,900 --> 00:06:47,620
So let's start build Broaddus once again started.

92
00:06:48,550 --> 00:06:49,450
Count seconds.

93
00:06:51,560 --> 00:06:54,410
And process was finished just in four seconds.

94
00:06:54,920 --> 00:07:01,610
And the reason for that is the Dulquer history used guest data that it stored during previous build

95
00:07:01,620 --> 00:07:08,750
brought us, for instance, on this step number one, Dulquer didn't pull all necessary layers of this

96
00:07:08,900 --> 00:07:15,320
Docker image called Python, because all those layers were already pulled from the Docker hub and stored

97
00:07:15,320 --> 00:07:16,040
locally.

98
00:07:16,760 --> 00:07:21,260
That's why Docker has simply law that those letters from internal storage.

99
00:07:22,040 --> 00:07:29,750
Also, you see that on the next steps we see Cast Hero here or for instance, here and I told you,

100
00:07:29,750 --> 00:07:36,680
the Docker has created separate layers of the image at each step Europe or, for instance, here.

101
00:07:37,310 --> 00:07:43,700
And those steps in Docker, a file where are not modified, for instance, such file in our API, a

102
00:07:43,700 --> 00:07:45,530
folder remained unchanged.

103
00:07:45,620 --> 00:07:49,490
This way, there was no need to recreate such layer.

104
00:07:49,910 --> 00:07:53,150
It remains unchanged this way.

105
00:07:53,180 --> 00:07:57,830
Docker simply reused previously created layers this way.

106
00:07:57,860 --> 00:08:00,590
Such a rebuild process went much, much faster.

107
00:08:01,160 --> 00:08:04,700
Finally, it exported result in glare of the image.

108
00:08:05,240 --> 00:08:11,630
It has created image with such house, and it has given name image as gallery API.

109
00:08:11,810 --> 00:08:13,410
The resulting image?

110
00:08:13,790 --> 00:08:19,820
And now, if I enter Docker images, I'll find out that there was a repository, title images, gallery

111
00:08:19,820 --> 00:08:26,060
API or these custom image with such ID and there is added latest.

112
00:08:26,450 --> 00:08:28,550
And that's how Docker behaves by default.

113
00:08:28,760 --> 00:08:30,410
If you don't specify it there.

114
00:08:30,470 --> 00:08:37,340
It adds that latest and notice that Greece and time of this image did not change because we did not

115
00:08:37,340 --> 00:08:41,340
recreate image, it simply has added new tech.

116
00:08:41,360 --> 00:08:44,540
Thus, it image itself remained unchanged.

117
00:08:45,230 --> 00:08:51,710
All right now we're able to proceed and use this image in order to create new container where we will

118
00:08:51,710 --> 00:08:53,750
run Python Flask obligation.

119
00:08:54,110 --> 00:08:55,140
And let's proceed with that.

120
00:08:55,160 --> 00:08:56,150
After the small smallpox.

