-: Throughout this course, we've been making use of images
that have been created by other engineers.
So for example, we have used,
say the Hello World Image or Redis, or BusyBox.
These are all images that were created by other engineers.
We download them onto our local machine
and then created a container out of them.
At this point, we're gonna start to figure out
how we can build our own custom images
so that we can run our own applications
inside of our own personalized containers.
The process for making an image is somewhat straightforward.
Like all things,
you just have to learn a little bit of syntax.
So here's what we're going to do to make our own image.
We're gonna create something called a dockerfile.
A dockerfile is essentially a plain text file
that is going to have a couple of lines of configuration
placed inside of it.
This configuration is going to define
how our container behaves,
or more specifically what different programs
it's going to contain
and what it does when it starts up as a container.
Once we create that dockerfile,
we'll then pass it off to the docker client
which you'll recall is the docker CLI
that we've been using at our terminal.
In turn, the docker client will provide the file
to the docker server.
The docker server is what is doing the heavy lifting for us.
It's going to take the dockerfile,
look at all the lines of configuration
that we have inside of it,
and then build a usable image
that can then be used to start up a new container.
Now the dockerfile is where
all the complexity is going to sit.
And like I just said a moment ago,
it's not really gonna be the worst thing in the world.
It's just about learning a couple of new commands.
That's all.
In fact, just about every dockerfile
that you and I are going to put together
is almost always going to look the same.
Inside of every dockerfile,
we're always going to specify a base image,
and we'll talk about what that means in just a moment.
It's going to be one of the first things we have to do.
After that, we'll add in some additional configuration
to run commands to add in some dependencies
or some more software, some more programs that we need
to successfully create and execute our container.
And then finally we will specify a startup command
for the image.
So anytime we take that image
and create a container out of it,
it will be the command that is executed
to essentially boot up or start the container.
It's the same command that we've been talking about
around all of these images all along.
Okay, so that's it.
That's all we have to do to make our own image,
essentially just revolves around writing a dockerfile.
So let's take a quick pause right here.
We'll come back to the next section
and get started working on our dockerfile.