I have just demonstrated to you what is actually entry point and where it is located.
There was actually a specific file inside of the container inside of the image that is used for creation
of the container and the debt the executable file is executed after creation of a new container.
And in this case this file is located in user a local being folder.
And also we have seen that in use there being the folder there were a bunch of executable files like
MONGO MONGO MONGO dump that are related to installation of Mongo and now it's a good time to lounge
Mongo properties it is Mongo shell and connect from it to Mongo DB process let let's do that in this
separate app let me clear terminal here and first of all let me simply type Mongo here in my terminal
without connection to container Let's type Monaco and of course I'll get error command not found that's
because Monaco is not installed on this micros computer and in this case you are able to connect on
one good deeper waters inside of the container using Mongo shell it brought us inside of the same container
or if you want are able to create additional monitor container and lounge Mongo process data and connect
from that container to a container that does run in Mongo do but it is very complicated it is much more
simpler to connect to mongo brought us from mongo shell inside of the same container.
So let us do that now and for that we will use again Mongo exact command and we will start additional
Mongo process there.
Let's do so about exactly this idea here will be idea of the running container.
It starts with 5 7 if you have forgotten your idea use Dr. P S command to find out it and next let's
type here Monaco again in such case we will create additional process and we will start Mongo command
inside of the container with a D that starts with 5 7 great let's press Antara and you'll see prompt
that tells us that we were actually connected to mongo D process from mongo shell and here we are able
to perform some actions for example we are able to find out a version of this Mongo database for example
using command Debbie dot version and don't forget to add here layer of parentheses like so and I see
the dimension is 4 not two good 5 in your case latest tech maybe our science 2 newer version of Mongo
database great.
Next we're able to list databases that we created by default for example using comment so DBS and there
are three databases admin contact and local and let's not try to create additional custom database and
insert some data into the database we are able to create additional database using the command use and
next name of the database and let's create a database named test for example.
So each to the B test and you failed type now debut you should see that we are now inside of the database
test and now let's create a new collection inside of this database and this collection will be called
animals and let's insert one or two records inside of that new collection for that simply type comment
command Debbie animals insert then pair of parentheses like so here next inside of those parenthesis
at bay are off curly braces like so and it will be an object that will be inserted into new collection
of gold animals and let's add here a single key value pair like animal column and here we'll be kept
kept last press enter the right result insert that one let's insert one more record and here we'll be
animal let's say dog like so and one more let's say monkey.
And now let's read the records from animals collection.
Animals bind and here simply pair of brand like so and I'll get three objects and you'll also see additional
underscore D that was automatically created for every record and that actually means that there was
no custom database gold test and inside of the database there is a new collection of gold animals and
we have created three additional records inside of this animal collection why I wanted to demonstrate
to that I want now to stop this container then create new container Mongo container and verify whether
this new container we'll have those records and these databases are not.
Let's do that let's exit from this Mongo shall authorized I see by and next door lengths least containers
Docker IP is.
And now let's stop this container with this idea first Docker stop.
And here will be 5 7 container will stopped Docker.
P.S. I don't see any containers anymore.
And now let's create one more container using Mongo image Docker run Mongo.
Again I see output from one good deep brought us let's open up new tab leased containers here Docker
appears and now let's connect via Mongo shell to this Mongo DB process inside of this container I'll
use this idea Docker exec this idea to one and here we'll be at Mongo protest that I want to start I
am now inside of the Mongo shell and I am connected now to mongo deep thoughts running on the same computer
where I have started Mongo shell it is actually a local host in this case this same container and no
let's list databases show debuts and I see again three initial databases without their database.
And that means that these new container that is run in Congo has its own database.
It does not have access to previous database that was created in the previous container.
It is a very important conclusion.
The moment.
Now let me go out from this container and let me actually stop this container.
Let me use its idea Doctor stop to one container was stopped and let's no start over previous container
I.D. five seven were kept at this container is marked now as stopped and if I'll have a look at the
list of containers using the docker.
Yes that's a comment.
I'll see those two containers here on the list and let's not start over this container that is no stopped
for that simple use command Docker start and a D of the stopped container or its name container was
started and let me have a look at the container was now dog rape yes and yes there was container ground
Iranian but it seems that the Mongol due process is not currently run in by ground here it was terminated
when we have stopped container before him let me close this step and let me in this step Lisa containers
Dr. Pierce and to connect again from mongo shell to mongo deep brought us Docker exec this idea five
seven Mongo and I am again connected to Mongo DB brought us to mongo database lets list databases so
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
the contents of the animal collection BBM don't animals not find and buy our brand this is like so and
I again see records that I have insulted and does because I feel again connected to the container that
was used for creation of this database and those are records inside of the animals collection all right
and no question how do we able to persist database Mongo database on our computer and be able to use
same database from different containers.
Let me answer this question in the next lecture I'll see you just in a moment.
Bye bye.