1
00:00:02,180 --> 00:00:04,426
<v ->By now we explored the core concepts</v>

2
00:00:04,426 --> 00:00:07,370
about Images and Containers.

3
00:00:07,370 --> 00:00:10,027
And I just want to provide a first summary,

4
00:00:10,027 --> 00:00:14,752
on those concepts to ensure we're all on the same page.

5
00:00:14,752 --> 00:00:18,610
With Docker, it's all about Our Code in the end.

6
00:00:18,610 --> 00:00:19,797
Our application we're building

7
00:00:19,797 --> 00:00:22,952
for example our web application.

8
00:00:22,952 --> 00:00:27,273
We put that code that makes up our application,

9
00:00:27,273 --> 00:00:29,182
into a so called Image.

10
00:00:29,182 --> 00:00:31,386
And we don't just put Our Code in there,

11
00:00:31,386 --> 00:00:33,629
but also the Environment,

12
00:00:33,629 --> 00:00:37,110
the tools we need to execute that Code.

13
00:00:37,110 --> 00:00:40,053
You learned that you can create such an Image,

14
00:00:40,053 --> 00:00:42,625
by creating such a Dockerfile,

15
00:00:42,625 --> 00:00:46,113
where you provide detailed instructions,

16
00:00:46,113 --> 00:00:49,670
on what should go into the Image,

17
00:00:49,670 --> 00:00:52,860
which base image you might be using,

18
00:00:52,860 --> 00:00:55,981
which code and which dependencies should be copied in there,

19
00:00:55,981 --> 00:01:00,871
if maybe some setup step like npm install is required,

20
00:01:00,871 --> 00:01:04,804
and if you then want to open up some internal port,

21
00:01:04,804 --> 00:01:06,712
so that you can listen to that

22
00:01:06,712 --> 00:01:09,456
from outside of the imagined deal

23
00:01:09,456 --> 00:01:12,763
for ultimately outside of the container in the end.

24
00:01:14,195 --> 00:01:16,117
And that's of course important.

25
00:01:16,117 --> 00:01:21,056
Docker ultimately is about containers, not images.

26
00:01:21,056 --> 00:01:24,458
But images are an important building block,

27
00:01:24,458 --> 00:01:29,458
they are the template, the blueprint for your containers.

28
00:01:29,532 --> 00:01:31,868
You can then instantiate,

29
00:01:31,868 --> 00:01:36,868
run multiple containers based on an Image.

30
00:01:36,937 --> 00:01:41,600
The Image is the thing that contains your Code and so on.

31
00:01:41,600 --> 00:01:42,958
The container as you learned

32
00:01:42,958 --> 00:01:46,948
is just an extra thin layer on top of the Image,

33
00:01:46,948 --> 00:01:49,205
but still the container in the end

34
00:01:49,205 --> 00:01:53,729
is your running application, based on an image,

35
00:01:53,729 --> 00:01:55,531
but then once it is running,

36
00:01:55,531 --> 00:01:59,633
standalone and independent from other containers

37
00:01:59,633 --> 00:02:01,160
that might be running.

38
00:02:01,160 --> 00:02:02,862
I want to emphasize though,

39
00:02:02,862 --> 00:02:06,259
that a container does not copy over the code

40
00:02:06,259 --> 00:02:10,774
and the environment from the image into a new container

41
00:02:10,774 --> 00:02:11,943
into a new file.

42
00:02:11,943 --> 00:02:13,783
That is not what's happening.

43
00:02:13,783 --> 00:02:18,430
A container will use the environment stored in an image,

44
00:02:18,430 --> 00:02:22,020
and then just add this extra layer on top of it,

45
00:02:22,020 --> 00:02:25,390
this running node server process for example,

46
00:02:25,390 --> 00:02:29,770
and allocate resources, memory and so on

47
00:02:29,770 --> 00:02:30,839
to run the application,

48
00:02:30,839 --> 00:02:33,627
but it will not copy that code.

49
00:02:33,627 --> 00:02:36,401
So Our Code and the node environment,

50
00:02:36,401 --> 00:02:39,531
is not getting copied three times here.

51
00:02:39,531 --> 00:02:42,015
If we have one image and two containers,

52
00:02:42,015 --> 00:02:46,330
it exists only once in the image and to containers,

53
00:02:46,330 --> 00:02:49,453
then utilize that image and the code in it.

54
00:02:49,453 --> 00:02:51,362
This is how Docker manages this,

55
00:02:51,362 --> 00:02:54,233
and that's of course very efficient.

56
00:02:54,233 --> 00:02:56,745
And that's the core idea behind Docker.

57
00:02:56,745 --> 00:03:00,371
Having those isolated environments that contain your app,

58
00:03:00,371 --> 00:03:03,400
and everything that is required to run that app,

59
00:03:03,400 --> 00:03:07,014
all the environment, all the tools like node js,

60
00:03:07,014 --> 00:03:10,200
and having all of that inside of this isolated container.

61
00:03:10,200 --> 00:03:11,990
That's what Docker is about,

62
00:03:11,990 --> 00:03:14,434
and that will be covered thus far,

63
00:03:14,434 --> 00:03:16,593
over the last lectures.

