1
00:00:04,430 --> 00:00:10,130
I have just demonstrated to you what is actually entry point and where it is located.

2
00:00:10,130 --> 00:00:15,200
There was actually a specific file inside of the container inside of the image that is used for creation

3
00:00:15,260 --> 00:00:21,080
of the container and the debt the executable file is executed after creation of a new container.

4
00:00:21,500 --> 00:00:26,300
And in this case this file is located in user a local being folder.

5
00:00:26,450 --> 00:00:31,910
And also we have seen that in use there being the folder there were a bunch of executable files like

6
00:00:31,910 --> 00:00:38,930
MONGO MONGO MONGO dump that are related to installation of Mongo and now it's a good time to lounge

7
00:00:39,020 --> 00:00:46,400
Mongo properties it is Mongo shell and connect from it to Mongo DB process let let's do that in this

8
00:00:46,490 --> 00:00:54,110
separate app let me clear terminal here and first of all let me simply type Mongo here in my terminal

9
00:00:54,140 --> 00:01:01,100
without connection to container Let's type Monaco and of course I'll get error command not found that's

10
00:01:01,130 --> 00:01:08,710
because Monaco is not installed on this micros computer and in this case you are able to connect on

11
00:01:08,710 --> 00:01:14,570
one good deeper waters inside of the container using Mongo shell it brought us inside of the same container

12
00:01:14,990 --> 00:01:21,050
or if you want are able to create additional monitor container and lounge Mongo process data and connect

13
00:01:21,050 --> 00:01:26,780
from that container to a container that does run in Mongo do but it is very complicated it is much more

14
00:01:26,780 --> 00:01:32,630
simpler to connect to mongo brought us from mongo shell inside of the same container.

15
00:01:32,630 --> 00:01:39,110
So let us do that now and for that we will use again Mongo exact command and we will start additional

16
00:01:39,260 --> 00:01:40,750
Mongo process there.

17
00:01:40,760 --> 00:01:47,480
Let's do so about exactly this idea here will be idea of the running container.

18
00:01:47,480 --> 00:01:54,140
It starts with 5 7 if you have forgotten your idea use Dr. P S command to find out it and next let's

19
00:01:54,140 --> 00:02:01,700
type here Monaco again in such case we will create additional process and we will start Mongo command

20
00:02:01,730 --> 00:02:09,600
inside of the container with a D that starts with 5 7 great let's press Antara and you'll see prompt

21
00:02:09,870 --> 00:02:16,620
that tells us that we were actually connected to mongo D process from mongo shell and here we are able

22
00:02:16,620 --> 00:02:23,940
to perform some actions for example we are able to find out a version of this Mongo database for example

23
00:02:23,940 --> 00:02:29,970
using command Debbie dot version and don't forget to add here layer of parentheses like so and I see

24
00:02:29,970 --> 00:02:37,740
the dimension is 4 not two good 5 in your case latest tech maybe our science 2 newer version of Mongo

25
00:02:37,830 --> 00:02:39,570
database great.

26
00:02:39,570 --> 00:02:47,610
Next we're able to list databases that we created by default for example using comment so DBS and there

27
00:02:47,610 --> 00:02:55,080
are three databases admin contact and local and let's not try to create additional custom database and

28
00:02:55,140 --> 00:03:01,800
insert some data into the database we are able to create additional database using the command use and

29
00:03:01,800 --> 00:03:07,440
next name of the database and let's create a database named test for example.

30
00:03:07,440 --> 00:03:13,020
So each to the B test and you failed type now debut you should see that we are now inside of the database

31
00:03:13,020 --> 00:03:18,540
test and now let's create a new collection inside of this database and this collection will be called

32
00:03:18,600 --> 00:03:24,520
animals and let's insert one or two records inside of that new collection for that simply type comment

33
00:03:24,530 --> 00:03:32,340
command Debbie animals insert then pair of parentheses like so here next inside of those parenthesis

34
00:03:32,400 --> 00:03:38,040
at bay are off curly braces like so and it will be an object that will be inserted into new collection

35
00:03:38,040 --> 00:03:45,760
of gold animals and let's add here a single key value pair like animal column and here we'll be kept

36
00:03:45,890 --> 00:03:53,700
kept last press enter the right result insert that one let's insert one more record and here we'll be

37
00:03:53,700 --> 00:03:59,460
animal let's say dog like so and one more let's say monkey.

38
00:04:00,500 --> 00:04:04,420
And now let's read the records from animals collection.

39
00:04:04,710 --> 00:04:13,710
Animals bind and here simply pair of brand like so and I'll get three objects and you'll also see additional

40
00:04:13,740 --> 00:04:19,750
underscore D that was automatically created for every record and that actually means that there was

41
00:04:19,750 --> 00:04:26,760
no custom database gold test and inside of the database there is a new collection of gold animals and

42
00:04:26,760 --> 00:04:32,820
we have created three additional records inside of this animal collection why I wanted to demonstrate

43
00:04:32,820 --> 00:04:40,690
to that I want now to stop this container then create new container Mongo container and verify whether

44
00:04:40,800 --> 00:04:45,770
this new container we'll have those records and these databases are not.

45
00:04:46,170 --> 00:04:53,600
Let's do that let's exit from this Mongo shall authorized I see by and next door lengths least containers

46
00:04:53,660 --> 00:04:54,740
Docker IP is.

47
00:04:55,170 --> 00:05:01,270
And now let's stop this container with this idea first Docker stop.

48
00:05:01,410 --> 00:05:06,220
And here will be 5 7 container will stopped Docker.

49
00:05:06,230 --> 00:05:08,980
P.S. I don't see any containers anymore.

50
00:05:09,250 --> 00:05:18,640
And now let's create one more container using Mongo image Docker run Mongo.

51
00:05:18,860 --> 00:05:24,900
Again I see output from one good deep brought us let's open up new tab leased containers here Docker

52
00:05:24,930 --> 00:05:32,300
appears and now let's connect via Mongo shell to this Mongo DB process inside of this container I'll

53
00:05:32,300 --> 00:05:43,160
use this idea Docker exec this idea to one and here we'll be at Mongo protest that I want to start I

54
00:05:43,210 --> 00:05:49,220
am now inside of the Mongo shell and I am connected now to mongo deep thoughts running on the same computer

55
00:05:49,220 --> 00:05:55,400
where I have started Mongo shell it is actually a local host in this case this same container and no

56
00:05:55,400 --> 00:06:04,510
let's list databases show debuts and I see again three initial databases without their database.

57
00:06:04,670 --> 00:06:11,090
And that means that these new container that is run in Congo has its own database.

58
00:06:11,090 --> 00:06:16,360
It does not have access to previous database that was created in the previous container.

59
00:06:16,370 --> 00:06:17,880
It is a very important conclusion.

60
00:06:17,870 --> 00:06:19,020
The moment.

61
00:06:19,010 --> 00:06:24,810
Now let me go out from this container and let me actually stop this container.

62
00:06:24,830 --> 00:06:34,630
Let me use its idea Doctor stop to one container was stopped and let's no start over previous container

63
00:06:34,960 --> 00:06:41,740
I.D. five seven were kept at this container is marked now as stopped and if I'll have a look at the

64
00:06:41,740 --> 00:06:43,350
list of containers using the docker.

65
00:06:43,410 --> 00:06:44,880
Yes that's a comment.

66
00:06:45,040 --> 00:06:50,830
I'll see those two containers here on the list and let's not start over this container that is no stopped

67
00:06:51,190 --> 00:06:59,710
for that simple use command Docker start and a D of the stopped container or its name container was

68
00:06:59,770 --> 00:07:05,850
started and let me have a look at the container was now dog rape yes and yes there was container ground

69
00:07:05,960 --> 00:07:12,730
Iranian but it seems that the Mongol due process is not currently run in by ground here it was terminated

70
00:07:12,730 --> 00:07:20,230
when we have stopped container before him let me close this step and let me in this step Lisa containers

71
00:07:20,350 --> 00:07:28,430
Dr. Pierce and to connect again from mongo shell to mongo deep brought us Docker exec this idea five

72
00:07:28,480 --> 00:07:37,410
seven Mongo and I am again connected to Mongo DB brought us to mongo database lets list databases so

73
00:07:37,500 --> 00:07:46,290
debuts and I see my database here on the list let's wish to eat use test and now let's have a look at

74
00:07:46,290 --> 00:07:54,330
the contents of the animal collection BBM don't animals not find and buy our brand this is like so and

75
00:07:54,450 --> 00:08:01,320
I again see records that I have insulted and does because I feel again connected to the container that

76
00:08:01,650 --> 00:08:08,690
was used for creation of this database and those are records inside of the animals collection all right

77
00:08:09,210 --> 00:08:17,790
and no question how do we able to persist database Mongo database on our computer and be able to use

78
00:08:17,850 --> 00:08:21,260
same database from different containers.

79
00:08:21,660 --> 00:08:25,500
Let me answer this question in the next lecture I'll see you just in a moment.

80
00:08:25,500 --> 00:08:25,850
Bye bye.

