We have just successfully agreed the first to mongo container and we have seen the some logs in the
terminal but now we are not able to interact with this process because we're actually connected to mongo
deep waters.
That stands for Mongo database.
Knowing this Loescher I'll demonstrate to you how you are able to create additional brought us inside
of the container and perform some actions inside of the process.
For example you are able to create the bash or c h shell process or you are able to launch Mongo shell
brought us.
All right let's try that.
Here in this location and also I'll explain what happens under the hood basically when you create Mongo
container.
So this lecture is very important.
Please don't skip it.
Great.
Let's open up but new tab and let's first have a look at containers that are currently running Docker
B.S. and there was some good container that was created from mongo image.
Notice that the container Alison's at Port went to 7 0 1 7 or DCP and that is actually the default to
mongo deep port.
And also notice that command that was executed upon start upon a creation of this container was Docker
and three point dot c h.
It is not Mongo deep.
And before explaining what the docker entry point does C H means let me show you how we're able to start
additional brought us inside of this container and we will try to start first bash shell brought us
all right.
For that you could simply use additional dock our command gold Docker exact or docker container.
If you'll have a look at the amounts Docker does help you'll find the exact command somewhere.
Here let me scroll a bit up.
So here is this command run a command in a running container and that's what we actually need to do.
We need to launch additional process inside of the run container.
And also if I'll have a look at the help for docker container you should also find the same command
there.
Let me scroll a bit up.
Yes here is this command run a command and Orion container.
So you're able to use eyes on Docker exact comment or docker container exact.
I prefer to use the shorter versions of all commands Docker Exactly.
Next comes a D or name of the container the discount Iran.
And basically let me quickly find out this idea you could use eyes of this I.D. as usually or this random
name or you are able to assign a custom manual name when you start your container.
So I'll use the first two characters of this idea and talker exactly 5 7 and we are able to start eyes
or see a show or better show.
Basically both executable are available inside of the Mongo image.
Let's allow best left press enter and we see that we have redone the back to our terminal.
Could you please answer the question why this happened
answer is very simple.
We can look the connected to SD the end of this bash brought us and of course as we have seen before
in such cases.
C H or bash processes exit for that in order to be able to connect to best products interactively and
greed.
So today.
Let's adhere to options.
And deep like so let's not press enter and now we are connected to our container with a D.
5 7 and so on as a root user inside of the best brought us and now we're able for example list files
here you'll see bunch of files and folders.
Also we're able to create additional files and folders and so on.
Again we are connected via additional process to container.
Let us actually try at least to all processes that are current running inside of this container because
actually there was bashed brought us here in this window and a NAS brought us Mongo d in this step.
Great.
Let's now enter the s dash e command that will show us actually all processes that are running now inside
of the container.
Let's press enter and you see three processes thrust brought us here on this list is Mongo DB and it's
process a D is one it is called early brought us next for this is bash it has a random process a d 1
1 3 and there was also additional process B S that was actually just exited after we have entered this
command and the youth process idea is 1 2 3 but again most importantly that we are able to start multiple
processes in the same container.
I am actually able to open up new tab like so and start additional process.
Let me start the c h process and I'll use the same idea as I have used here 5 7 Docker exec dash item
5 7 8 process and I am now in C H shell and if I'll have a look again at the list all protesters here
for example I should see additional process on the list it is C H and now there are actually four processes
surrounding it but basically P S was just terminated that's how you are able to create additional processes
inside of running container it is a very very simple.
And for that you should use command Docker exact or docker container.
Exactly.
All right let's not make apples and next let's proceed.
And the deep freezer.
And next I'll explain you what the entry point both c h means here in this output.
I'll see you in a bit.
Bye bye.