 Welcome back in this video. We'll learn to build and test containers on your local OpenShift cluster. For that we'll use a Docker file. I have a Docker file in my git repository and it uses a real base image and there is a script this Docker file refers to which displays the time. So we'll use this example build a container and apply that container onto the local OpenShift cluster, test it, make changes and test it again. That's our exercise. First I'll import this project from the git repository. We'll select this projects from git with smart import. We'll clone it using a URI, provide the URI here and any authentication that is needed to connect to the git repository. Just leave it as defaults and I'll finish. So now we have the git repository cloned locally. Now I'm selecting the real based image that I just showed you. This is Docker file. Now let's switch the perspective quickly. You are seeing the jboss perspective right now and then we'll switch to Docker tooling perspective that you'll see as an icon here. Let's click on that. Now the perspective switches to Docker tooling perspective. It's by default pointing to your local Docker environment. We would want to build this container as part of this container development environment. If you remember when you install CDK, we first start a VM and many shift gets installed on that VM. This container development environment is inside that VM. So we want to connect to the Docker daemon that is running inside the container development environment. So if you look at the list of containers, these are the existing parts that are running on my on the open shift cluster, which is running inside that VM. And these are the images that are available in the Docker daemon that is running inside the VM. Now let's build the container image. I'm selecting this code, right click, run as Docker image build show a configuration. Let's select the connection that points to the container development environment and I'll provide an image name. I'll call it roll time and say, okay, now you can see that the build is in progress. All the steps are now complete and the image is successfully built and you can also see that under images here, it has real time and with the latest tag. Now let us deploy this container image that we just created as an application on OpenShift. So we'll switch to the OpenShift Explorer. We see that there is a my project here, right click on that, select this option deploy Docker image. It shows up a menu that allows you to select a container image to deploy. So we'll browse for that image. Now this shows us the list of images available in the container development environment. So here is the image that we just created. We'll select that real time image, say okay, and when the application gets created, it'll you would want this image to be created and pushed as an image stream in this registry. So this is our registry running on OpenShift. It shows you by default. We want this image to be pushed into this registry as an image stream and then deploy it. So just select this option push image to registry and say next, we want to run one instance of this app. There is nothing to build here. It will create a route as well. No labels, select all the defaults and finish. You can see that it is pushing the Docker image into the registry right now. The image is now pushed. You can see that there is a deployment configuration and there is a service for that new application. Now if I run this application, show in web browser, it shows the time. The pod name is also displayed here. Now let's change this image a little bit. Just show the entire cycle of how do we change the Docker file and test it again. Now switch back to this JBoss perspective. This Docker file refers this init.sh. So let's open that and make a small change in this file. In this file, I'll make a small change. I just added the text the current date and time is. We'll save these changes, select the Docker file and run Docker image build again. So it is running the build again. The build is now complete. Now let's see how we can connect to the internal registry. So I switched back to the Docker tooling view. The registry is running as a pod on the OpenShift environment here. So we'll connect to that registry. Let's first open the terminal. OpenShift client is available at user local bin. So we'll add it to the path. OC who am I would provide me the user ID that I'm logged in with. I'm logged in as a developer. OC who am I minus T will give me a token with which this user ID is logged in as. So this is the client token that is generated by OpenShift and exchanged with my client. I'll copy this client token. We'll use this to connect to the registry. Now we'll find the container image that we just updated and we'll try to push this container image into the registry. So I'll say right click on this real time image that we just created and I'll set the option push. Now it's trying to connect to the registry and it is trying to push that image but this image should be pushed into the image stream in the my project. You know if I try to push it now, it will fail because I didn't configure the registry. So let's configure access to registry. The registry IP address is 172.30.1.1 colon 5000 username to log in as is developer and the password is the token that we just copied. Now that we provided the credentials, I'll click on finish. This will push the image into registry. It just pushed it. If you notice there's a quick push that happened there. Now that the image is pushed, it should be automatically updated because the deployment configuration would say that hey, if the image changes in the image stream, automatically update the application. So a new part should be now running. So let's check the running app showing web browser. Now you can see the change. It says current date and time is so and so, right? So in this video, we have learned how to create a container image locally and test it on the local OpenShift cluster and also make changes to it and redeploy it on the local OpenShift cluster. I hope you enjoyed this video. Thanks a lot for watching.