 In this video I'm going to show you how to set up a very basic docker file for our project. Now one thing I like to do is as I work through these courses, if you're not familiar with taking any of my courses, I will create a new branch. So I'm going to come in here and add in a new branch. I'm just going to call this docker base. So we were previously on the main branch, now we are going to docker base. And this gives you the ability to see exactly what was changed in this video. So I will be doing that for the remaining videos where I'm actually changing code and you'll be getting a new branch. So you can do a compare of your code to a specific branch and see what was changed or what you're missing. So very handy tool to give you. So now I am on docker base and let's go ahead and set up a docker file. Now there's a couple of different ways that you can approach this. I'm going to put things under the main folder for the Maven project structure. Some people when they're doing projects, especially if they are using a build script, they'll put it in the docker file into the root of the project, which is perfectly fine. That is a valid way of doing that. But here I'm just going to show you a typical setup where I'm going to come in here and I'm going to say a new package. I'm going to call this docker base. And let's go ahead and create a new docker file. And by convention that is capitalized. So docker file all lowercase. And I will be adding that to the branch. And here I'm going to show you just a very basic vanilla docker file for running our spring boot application. So I'm going to say from open JDK. You can see I'm getting the autocomplete there from Tel-J, I'm going to say JRE. And I want the slim build, so this is a more efficient. And to be honest, you see I'm getting code complete for Buster, SID, and Stretch. I honestly don't know what those are. So I do know the slim build is a more efficient image. It doesn't have a lot of the tooling in there. So it's a very small lightweight image for us to work with. It does have the JRE, the Java runtime. So we are going to be putting in a JAR file, so that is already compiled so we don't need the JDK. The JRE is much smaller, so we have a much smaller image that we're going to be working with. And here we want to set up some environment. I'm going to steal from my working file here to the clipboard. I'm just going to paste this in from my clipboard. And here I'm setting an environment variable, Java Ops, and I'm setting up some memory limits for the JVM. And then this security from memory that goes through and helps initialize the JVM quicker and improves the startup time by setting that, I'm going to say WorkDir application. Now the trick is, we need to copy into our file. So we're going to be copying into the image that we're building in our Docker build script. And what we want to do is, we don't have it here yet. So if you don't see it, we want to run the package command. So in the lifecycle, we want to run package or verify either one of those or install, but package is the minimal one that we need. So I'm going to go ahead and package that. So now we do, in fact, get the JAR build, and that does run our test as well. So we only have, I think, one test out there that brings up the context of a pretty lightweight project. So we actually have four tests. I'm a spoke. So now what we want to do is copy. And this copy command is going to be relative to the location of the Docker file. So we need to go up a couple directories, and then we want to say, we're getting a target. It's not seeing it as a project file. And I see what I made, made a mistake. I actually put this here. I want that under main, let me do that quick refactor. So we have that under main, I mistakenly put it under Java, which is our class files. So we did not want that there. Now we're getting target in the auto complete. And we can see that we have these two. So the dot original is the slim jar. We want the fat jar. So that is going to be the executable jar there. So we'll go ahead and take that. That tells us to copy it, and we are going to copy it into the work directory. So the dot slash is saying copy it into the working directory of application. And then we want to do entry point. Now we're going to pass it a command line. So we're going to say Java. And here we want to give it the name of the jar. So this is a little lengthy and easy to mistype. So I'm going to copy that to the clipboard and we'll paste that in. So this is a very minimal Docker file for running in the spring boot application. So at the top we are seeing the Docker image that we want to pull from the JRE slim. We are setting environment variable for Java ops. We're just setting some memory limits and then the security and that helps with our application startup time. We are telling it the working directory called application. We are copying from our local file system. So we are doing a relative path there to target to the generated jar file. We are copying that into our Docker image. And then we are setting the entry point. And this is the command that is going to be running on startup. So this is the Docker file. In the next video I'll show you how we can run this from the command line.