1
00:00:04,170 --> 00:00:04,590
Okay.

2
00:00:04,590 --> 00:00:11,610
We have just added the favicon icons into our project and now we in browser see actually that those

3
00:00:11,610 --> 00:00:17,130
icons are added and we are able to see them here in the head section of the document.

4
00:00:17,160 --> 00:00:23,970
Now let me demonstrate you how we are able to get rid of this absolute path here in volume mapping and

5
00:00:23,970 --> 00:00:25,770
use variable instead.

6
00:00:26,070 --> 00:00:27,480
Why is that important?

7
00:00:27,510 --> 00:00:28,530
Answer is simple.

8
00:00:28,530 --> 00:00:34,230
If you will take this command and try to execute it on your computer, you'll definitely will fail because

9
00:00:34,230 --> 00:00:36,600
there is no such path on your computer.

10
00:00:36,600 --> 00:00:42,000
But with variable, you will be able to run this command on any of the computers.

11
00:00:42,030 --> 00:00:46,650
Okay, let me terminate this container control C Docker.

12
00:00:46,650 --> 00:00:53,160
PS There are no containers currently running and now remember that we have used command PWD in order

13
00:00:53,160 --> 00:00:55,650
to find out path to current folder.

14
00:00:55,650 --> 00:01:01,980
And now let me show you how you are able to use the command in order to automatically insert absolute

15
00:01:01,980 --> 00:01:05,349
path into the command that will create new container.

16
00:01:05,379 --> 00:01:10,210
Let's use same container docker run and same port as before.

17
00:01:10,240 --> 00:01:12,850
External port 8081.

18
00:01:12,850 --> 00:01:14,470
Internal port 80.

19
00:01:14,470 --> 00:01:16,570
And next comes volume mapping.

20
00:01:16,570 --> 00:01:23,380
And here, instead of absolute path on your local computer, we will use variable in following way dollar

21
00:01:23,380 --> 00:01:25,000
sign P.w.d..

22
00:01:25,300 --> 00:01:26,290
That's it.

23
00:01:26,620 --> 00:01:30,220
Next comes colon and again internal folder.

24
00:01:30,220 --> 00:01:33,190
Same as we have used for nginx server before.

25
00:01:33,190 --> 00:01:36,820
It is user share nginx.

26
00:01:37,090 --> 00:01:37,650
HTML.

27
00:01:37,660 --> 00:01:42,490
And next comes name of the image we want to create container from.

28
00:01:42,490 --> 00:01:44,110
And image is the same.

29
00:01:44,110 --> 00:01:45,130
Nginx.

30
00:01:45,370 --> 00:01:53,590
Great recap that we are now located still in nginx folder that has index.html file and all remaining

31
00:01:53,590 --> 00:01:54,660
favicon files.

32
00:01:54,670 --> 00:01:55,840
It is important.

33
00:01:55,870 --> 00:02:00,160
Let's press enter and now container should be running.

34
00:02:00,160 --> 00:02:03,130
Let's go back to web browser refresh page here.

35
00:02:03,160 --> 00:02:09,430
Actually let me use here localhost instead of my IP address because in your case IP address will be

36
00:02:09,430 --> 00:02:11,950
different, but localhost is the same everywhere.

37
00:02:11,950 --> 00:02:17,140
And let's refresh page recap that we have used same port as before in previous lectures.

38
00:02:17,170 --> 00:02:19,000
Let's press enter.

39
00:02:19,610 --> 00:02:20,590
And I see.

40
00:02:20,630 --> 00:02:21,470
Same result.

41
00:02:21,500 --> 00:02:23,960
Hello from the web page with fancy favicon.

42
00:02:23,960 --> 00:02:29,420
And actually, in order to verify that we serve correct content and it is not served from the cache.

43
00:02:29,420 --> 00:02:31,220
Let me modify this text.

44
00:02:31,250 --> 00:02:39,860
Hello from the let's say nginx server like so save the file, go back to Chrome refresh page and yes

45
00:02:39,860 --> 00:02:44,480
I see updated page and that means that this command works correctly.

46
00:02:44,480 --> 00:02:49,100
We have used here variable as dollar sign d.

47
00:02:50,100 --> 00:02:56,880
That's how it works and how you are able to insert automatically results of specific command basically

48
00:02:56,880 --> 00:02:57,720
under the hood.

49
00:02:58,080 --> 00:03:05,670
This computer executes command and inserts result basically result is here into this command.

50
00:03:05,850 --> 00:03:11,100
But if I'll move to another folder, this path will be different.

51
00:03:11,100 --> 00:03:17,790
And let me quickly actually show you that let me terminate this container and let me go one level up

52
00:03:17,820 --> 00:03:23,130
to Containers folder, and if I'll enter here, you'll see this path.

53
00:03:23,880 --> 00:03:32,520
Let me clear terminal and let's rerun the same command as before with dollar sign wd enter.

54
00:03:33,730 --> 00:03:39,490
Go to Google Chrome refresh page and see this page forbidden.

55
00:03:39,490 --> 00:03:46,630
And that means that something is wrong and there is actually no index.html file inside of that folder

56
00:03:46,630 --> 00:03:50,980
that is now mapped to internal folder in nginx server.

57
00:03:51,550 --> 00:03:57,520
Actually you are able to set it in the following way that in such cases web server will serve default

58
00:03:57,520 --> 00:03:58,150
web page.

59
00:03:58,150 --> 00:04:00,970
But now you see simply error forbidden.

60
00:04:01,330 --> 00:04:06,940
That is important because now you understand that you need to go first to folder that has index.html

61
00:04:06,940 --> 00:04:10,030
file and all remaining files and only there.

62
00:04:10,060 --> 00:04:11,530
Run this command.

63
00:04:11,650 --> 00:04:12,390
Great.

64
00:04:12,400 --> 00:04:14,050
Let me terminate this container.

65
00:04:14,050 --> 00:04:19,000
And now you know how to use variables in such commands as Docker run.

66
00:04:19,089 --> 00:04:24,040
Also let me demonstrate you how you are able to run container in background.

67
00:04:24,040 --> 00:04:25,270
But let's do that next.

68
00:04:25,270 --> 00:04:25,870
Bye bye.

