-: In the last section,
we went over the behind the scenes flow
of what occurred during that Docker build process.
Now that was a rather long section
and we went through a lot of detail.
So in this section I wanna do a quick recap,
just a very quick overview
on the really important critical flow to understand.
Now, if you don't wanna hear me lecture
about this stuff anymore,
if you feel like you already have a good understanding,
no problem, pause the video right now
and move on to the next section.
Again, we're only gonna do a recap
of what we just spoke about a moment ago.
Okay, so here's the recap with a slightly different diagram.
So everything started with the affirm Alpine instruction.
That told the Docker server or Docker daemon
to go and download the Alpine image.
And we use the Alpine image as a base because
it comes pre-installed with some really handy programs
that are useful for us creating our image.
The next thing that occurred
was the run instruction was executed by the Docker server.
The first thing that occurred there was it looked
for the image from the previous step,
and so it went back to the previous step
and got the Alpine image that had just been downloaded.
That image was then used to create a brand new
very temporary container.
So here's our container over here
and then the command that we had specified,
so apk add --update redis
was executed inside of that temporary container.
The APK program was executed.
It downloaded and installed Redis
inside the file system of that container.
So the result is a container with a modified file system.
It now has Redis added onto it.
We then took a snapshot of that container's new file system
and the result was a file system snapshot.
We then shut down the temporary container,
like this one right here that had just been created,
and we got our image ready for the next instruction.
And the image that we're using is that file system snapshot,
the modified one that we just created
when we installed Redis.
So you can now imagine
that we are now passing on to the next step.
We are essentially passing along the Alpine image,
but with Redis added on top.
So we then move on to the command Redis server instruction.
We again get the image from the previous step.
We again create a temporary container out of it,
but this time around,
rather than executing a command inside there,
which is the purpose of the run instruction,
we instead use the CMD instruction,
which is used to specify what the container should do,
or excuse me, what the image should do
when it is started up as a container.
So we told the temporary container that we just created
that whenever it gets started in the future,
it should try to execute the command redis-server.
And the result was a container
that has a modified primary command.
We then shut down that temporary container
and we got it ready, where you took an image out of it,
and got it ready for the next instruction.
But in that case, there are no more instructions,
no more steps to execute inside this file.
And so the output of the overall series of steps
is whatever image was generated
during the last instruction inside of our Docker file.
All right, so like I said, just a quick recap
on that entire process one more time, because it is,
it's not super critical
that you have an in-depth understanding here,
but it definitely makes a lot of this Docker stuff
a lot easier if you have a good grasp on this entire flow.
So let's take a quick pause right here
and we'll continue in the next section.