Welcome back.

In the last step we create an image for our Hallowell Python application 0 0 2 release and we were able to ban it in our local machine.

Let us now look at what's happening in the background.

When we were running the Lockerbie come in you can see that all here there are six steps which are one step one basic step two by six three by six four by six.

A little down if you go further down it's five six and six six.

And if you go further up.

Let me just scroll up you can see that each of these actually matches instruction in our doc file.

So in our profile we said the first line is from Python Alpine 310.

So that's the first step which is executed when we want to build from this as the base image.

The first thing that Docker daemon does is a download image for this particular thing.

So the base image is now being downloaded.

So that's what is happening in here.

And once the download of the base image is completed that's when it's saying OK let's use the word directly Yes slash up.

That's the step too.

So that's the step too which we have specified in here as well.

After that what it does is it copies the current folder.

So what is present in the current folder dot folder the file the folder where the docker file is present it is all copied into the slash app folder.

So inside the Docker image inside this slash up folder everything is copied down there.

And once it's copied what we are doing is inside this slash app folder.

So what is the working directory.

They're working directly slash up.

So whenever we execute a command it would be run in this slash app folder.

So it would run this command pip install hyphenated requirements are fixed and all here you can see that there are a lot of things that are being downloaded so flask and the dependencies of flask are downloaded.

So all these are needed so that you can run a REST API with Python so you can see that all of them are downloaded.

And once the download is complete pulled five thousand is exposed.

And after that you would see that the python launched out by is executed.

And after that the container image is enough already.

Now what I'll do is I'll disconnect from the logs I don't see and clear and would Docker images or here.

You can see that there is a Hello World Python image which is present in here.

Zero point zero point two.

Liz.

This is the image which we have just created and you will also see that this image is now added in to our local machine so you can see that Python Alpine 310.

Where is this coming from.

This is the base image.

So to be able to create the high level Python 0 0 2 release we needed the base image of Python Alpine 310.

So this image this base image is now downloaded on to our local machine.

Now let us do a simple Docker history and pass in the image.

So I am doing a history and passing the imagery.

If you go further down you would see that this is where it starts from.

So there are multiple layers in building this specific image.

So all these are the things which are involved inside the base image itself.

So up to here is the related to the base image.

And after that is where are instructions come in.

So work directly and then we are copying the intel directly in we are running pip install hyphen out requirements or text we are exposing 5000 and when.

And then we are setting a command line EXECUTION OF THE REST API with bite them in the step.

We look at what happened in the background when we did a docker Bill we saw that the exact instructions in the docker file are run as individual steps and then we were able to look at the docker history and see all these present as individual layers inside the dog image.

I'll see you on the next step.

  • No labels
Write a comment…