Welcome back.

In the previous tapes we exuded a number of Docker commands.

We lined up a few containers.

We looked at a few images and we are ready now to understand the architecture of Docker.

We know we are installing Docker desktop.

Earlier we installed Docker desktop on our machine.

We were actually installing two things.

One is something called a docket line and the other one is something called a darker demon.

So even the local installation of Docker uses something similar to a client server architecture Docker client is the client and the docker demon is like a server component.

We run the commands in Docker client and the dog a client sends them to Docker demon for execution.

So when we execute a command like Docker run the python image what Dr. Klein does is it set target what Dr. Klein does is it just sends that command out to the docker demon Docker demon is the one  which is really responsible for execution of that Pacific Command.

The doctor demon is responsible for a lot of things.

It is responsible for managing your containers managing your locally majors.

It is me responsible for pulling the image from the image repository and also at a later point in time do we create a number of Docker images on our local machine.

The Docker demon is also responsible for pushing those images out to the image repository.

Let's look at an example command that we ran earlier.

So we ran Docker images what would happen.

Dr. Klein would send the command out to Docker demon and the docker demon looks at the local images which are present and the results are sent back.

And that's the results which we are showing in here.

The same is the case when we ran the command docker container alias.

The command is we are executing on the docket line and Dr. Klein sends it out to the docker demon and it sees that there are no containers which are running at this specific point in time and if we do hyphenate the command is sent out to Docker demon and we get the containers the list of containers which are in varied kinds of statuses including stop and running a lot of communication also happens between the docker client and the docker demon.

When you try to run a container let us look at a couple of examples for that as well.

This is how we ran ah no JS application Docker ran high Fendi hyphen P five 5000.

The image name followed by the tag.

So let's run this and you can see that the container is enough launched up.

Now what is happening behind the screens is actually the docket line is sending the command out to the docker demon and the docker demon checks locally.

If this image is available so it will do something like Dockery majors and it would save Hallowell no

jerseys is available locally.

It seems that Hallowell no JS is available locally.

So what it does is it does not go to the doctor registry so it will actually directly use the local image which is present.

However if you are actually trying to run an application which is not pleasant locally let's say I would want to run a new application on port five thousand one and let's say I would want to use Hallowell rest api.

So what I'm doing is I'm trying to run Hallowell Rest Api which is not present locally in the local images which I present in here.

This image is not really present.

What would happen when I present it.

You can see that it is unable to find the image locally what is happening is the doc a client sends the command over to locally my doc demon sees that the image is not really present in the local images.

So what it does is it would talk to the docker registry which is the public Docker registry and it would try and download that specific image and it would try to run it.

You need to give a little while for this container to start ups or Docker logs let's see the logs have they started up yet the application is started up and up I can actually use port five thousand.

Now I can just look at those five doesn't want to run the application.

It says the application is not really working.

The reason why the application is not really working is because this application the container is not running on port five thousand.

The content is actually running on Port 88.

You can see that in the logs it is the Tomcat started on Port 88.

So when we want to expose something which is having container port ADHD we should also use that in our command.

So what I lose I'll do a docker container Alice and this is the Hallowell Rest Api which is running so let's stop that docker container stop that specific thing and let's try and launch it up again.

However all here we would want to expose container port 88 to contemporary ADHD should be exposed on host port five thousand one.

So whenever you are running a container you need to know which port the container is running on.

So this pesky container is running on Port ADHD and we want to make the port a of the container and map it to five.

Anyone on the host.

So you'd see that when I run this again.

Right now the image is not being downloaded again because this image has already been downloaded.

Dr. demon knows that the images locally available so it does not really go to the doctor hub to download the image so it would directly run it from local.

So let's look at the logs Docker logs hyphen f for one.

So I'm using the idea of the container which was launched up and it's cool.

It's actually says it's launching.

So let's see if your local list five thousand when it returns healthy through.

So this returns a different kind of response so don't worry about what response is coming back.

But the important thing that we all need to understand is the architecture of Docker.

So whenever we install Docker desktop means to lock a client and awkward demon whenever we send a command from the docker client it's executed by the demon whenever we try to run a container document checks the locally majors.

Is that specific image present locally.

If it's not present what it does is a toxic image registry gets the image down into our local images and then transmit as a container.

I'm sure you're having a wonderful time and I'll see you in the next step and then.

Well I.

  • No labels
Write a comment…