1
00:00:02,100 --> 00:00:04,100
Now the good news is that there's only

2
00:00:04,100 --> 00:00:06,844
a few things left which I wanna explore it with you.

3
00:00:06,844 --> 00:00:11,203
And the first thing takes us back to the images.

4
00:00:12,250 --> 00:00:14,060
This image contains your code

5
00:00:14,060 --> 00:00:15,930
and the application environment.

6
00:00:15,930 --> 00:00:18,050
That's what you'll learn throughout this course.

7
00:00:18,050 --> 00:00:19,850
That's why it's quite big.

8
00:00:19,850 --> 00:00:23,610
The running container is then actually not really that big,

9
00:00:23,610 --> 00:00:26,020
it's just an extra thin layer,

10
00:00:26,020 --> 00:00:30,070
the command layer basically, added on top of the image.

11
00:00:30,070 --> 00:00:32,860
So, this image code is used in the running container.

12
00:00:32,860 --> 00:00:35,870
it's not copied again, just to make this clear.

13
00:00:35,870 --> 00:00:37,920
The container builds up on the image,

14
00:00:37,920 --> 00:00:41,280
and multiple containers running based on the same image

15
00:00:41,280 --> 00:00:44,360
will share the code inside of the image.

16
00:00:44,360 --> 00:00:48,470
That's why this code inside of the image is also locked in

17
00:00:48,470 --> 00:00:52,180
and read only containers can only make changes,

18
00:00:52,180 --> 00:00:55,020
And for example, create files inside of

19
00:00:55,020 --> 00:00:58,860
that new extra thin container layer that was added on top

20
00:00:58,860 --> 00:01:00,730
of all the image layers.

21
00:01:00,730 --> 00:01:02,338
So, that's how that works.

22
00:01:02,338 --> 00:01:05,700
But if you wanna know more about an image,

23
00:01:05,700 --> 00:01:07,750
you also got a command for that,

24
00:01:07,750 --> 00:01:11,170
you got the Docker image inspect command,

25
00:01:11,170 --> 00:01:13,830
to which you can pass an image ID.

26
00:01:13,830 --> 00:01:17,860
And if you do so, you'll see a long output there

27
00:01:17,860 --> 00:01:21,103
with information about this image.

28
00:01:21,103 --> 00:01:23,270
And let's go through this output

29
00:01:23,270 --> 00:01:25,880
from top to bottom, to get a feeling

30
00:01:25,880 --> 00:01:29,870
for some important things you can learn from there.

31
00:01:29,870 --> 00:01:33,380
You for example, find the full ID of the image,

32
00:01:33,380 --> 00:01:35,350
you find the created date,

33
00:01:35,350 --> 00:01:38,960
to see when exactly this image was created.

34
00:01:38,960 --> 00:01:42,850
You see configuration for containers that will be executed

35
00:01:42,850 --> 00:01:45,080
that will be started based on the image,

36
00:01:45,080 --> 00:01:47,572
for example, which ports will be exposed,

37
00:01:47,572 --> 00:01:49,690
some environment variables

38
00:01:49,690 --> 00:01:52,360
which are set in this case automatically,

39
00:01:52,360 --> 00:01:56,270
and also the entry point, which by default is your command,

40
00:01:56,270 --> 00:01:59,260
If you don't specify a custom entry point.

41
00:01:59,260 --> 00:02:02,033
You see which Docker version is being used.

42
00:02:02,960 --> 00:02:04,060
And a bunch of other things

43
00:02:04,060 --> 00:02:06,120
which are not too important here.

44
00:02:06,120 --> 00:02:09,250
But further down you, for example, see the operating system

45
00:02:09,250 --> 00:02:11,210
which is being used, in this case

46
00:02:11,210 --> 00:02:13,360
because we're building up on the node image,

47
00:02:13,360 --> 00:02:15,360
which in turn builds up on

48
00:02:15,360 --> 00:02:18,570
some Linux operating system image.

49
00:02:18,570 --> 00:02:20,380
And if we scroll down further,

50
00:02:20,380 --> 00:02:23,630
we also see the different layers of this image.

51
00:02:23,630 --> 00:02:25,740
And keep in mind the different commands,

52
00:02:25,740 --> 00:02:28,550
make up the layers of this image.

53
00:02:28,550 --> 00:02:32,413
Now here we got 123456 instructions in front of command.

54
00:02:36,970 --> 00:02:39,460
But of course, we got more than six layers here.

55
00:02:39,460 --> 00:02:41,270
The reason for that is that it's not just

56
00:02:41,270 --> 00:02:45,270
about the layers defined in our Docker file.

57
00:02:45,270 --> 00:02:47,660
But we also automatically have two layers,

58
00:02:47,660 --> 00:02:50,940
provided by this node base image which we're using.

59
00:02:50,940 --> 00:02:54,130
So, our image uses all those layers in the end.

60
00:02:54,130 --> 00:02:55,550
Which of course makes sense

61
00:02:55,550 --> 00:02:58,550
because if the node image would change internally,

62
00:02:58,550 --> 00:03:02,750
that also should lead our image to not use caching,

63
00:03:02,750 --> 00:03:04,580
But to rebuild itself,

64
00:03:04,580 --> 00:03:06,830
if we would run the build command again.

65
00:03:06,830 --> 00:03:08,700
That's why we also have two layers

66
00:03:08,700 --> 00:03:11,490
from the base image we're using.

67
00:03:11,490 --> 00:03:13,240
And that's the inspect command,

68
00:03:13,240 --> 00:03:14,760
which you don't need all the time.

69
00:03:14,760 --> 00:03:17,073
But which can be interesting from time to time,

70
00:03:17,073 --> 00:03:19,940
to see how your image is configured.

71
00:03:19,940 --> 00:03:23,510
And how the containers you'll start based on this image,

72
00:03:23,510 --> 00:03:24,710
will be configured.

73
00:03:24,710 --> 00:03:27,450
Just in case you forgot or maybe

74
00:03:27,450 --> 00:03:29,930
because you pulled in some other image,

75
00:03:29,930 --> 00:03:33,410
from some other source, and you wanna look into it

76
00:03:33,410 --> 00:03:36,380
and see some general configuration.

77
00:03:36,380 --> 00:03:40,060
For example here, we could do that for denote image.

78
00:03:40,060 --> 00:03:44,200
We can of course also run Docker image inspect

79
00:03:44,200 --> 00:03:46,090
on that image.

80
00:03:46,090 --> 00:03:50,060
And now we see the configuration of that image,

81
00:03:50,060 --> 00:03:53,410
just in case you should be interested in that.

82
00:03:53,410 --> 00:03:55,840
So, that's how you can inspect images and look

83
00:03:55,840 --> 00:03:58,653
into them after they have been created.

