5 steps to Deploy docker image to Kubernetes (FOR BEGINNERS UPDATED)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video I'll show you four main steps required to push a Docker image to a Docker after registry that is first one how to create a Docker file second one how to create a repository in Docker have heard how to create a Docker image from a Docker file for how to push a Docker image into a Docker Hub registry repository make sure you stick around to the end because I am gonna share with you simple steps to create a pod in kubernetes cluster using this newly created Docker image prerequestic for this lab exercise is the first one Docker should be installed on your laptop and it should be in a running State second one you should have a Docker Hub free account created so that we can push this particular Docker image into the docker Hub repository third one it is specifically for the windows users git bash should be installed on your laptop so that it will help us to run Docker commands using git bash fourth one it is for the bonus tip that is a mini Cube kubernetes cluster it should be installed on your laptop so that we can create a kubernetes port using our newly create created Docker image creation of a Docker file let us create folder called as a Docker and let a CD into the docker file let us do a VI Docker file note that here D is capital F is small in this Docker file we would be extending the existing nginx that is the reason we are writing it from nginx itemizing the index.html that is the second command if you see here copy index.html from our current folder to user USR share nginx HTML folder slash index.htm what we are doing here is just a copy current in current folder we will create a index.html that will overwrite the existing index.html let us create another file called as index.html VI index.htm and let us enter a few details from our PPT let us go to insert mode and then let us copy the data from our PPT let us paste it in index.html yeah let's save this in this way we create a simple Docker file written Docker hub first you need to log into hub.docker.com with your credentials if you don't have account just create it and log into that you will get a create repository click on that and then give a name so uh I will say engine next demo and then go for either public or private based on your use case I will go for a public and click on create once it has been created so what we would require is this details just copy this bit okay so in this way we create a Docker Hub repository we create a Docker image from a Docker file for that go to your Docker folder just list it out so you have a Docker file and as well as the index.html in order to build the image type Docker build minus t and then here and then just say dot dot means the present working directory wherever your Docker file resides just enter it so it will take couple of minutes so if you could see one of two first one is fetching the docker.io nginx the base image downloading it locally and then copying the second part second task is in this Docker file copying index.html from the present working directory to the destination image so if I do a Docker images you would be able to see this particular image has been created 28 seconds ago okay so as a next step how to push newly created Docker image into Docker Hub repository for that basic command is docker push and give this repository name and then version 1.0 okay note that I have already logged into Docker so that is the reason I am not authenticated against Docker app if you have not already logged in you need we need to do another extra step called as a Docker login and you know to get authenticated against the docker app then only you should be able to run this particular command so let us run it so if you could see the docker image what it was created it was built on my laptop okay now with this Docker push beginner Academy 1.0 we have pushed it to our Docker Hub repository push is completed so let us go and do a refresh so if I go to tags you would be able to see pushed in a few seconds ago by beignet Academy so now we could see our nginx demo has a one version that is just now we have pushed it now is the time for the bonus step which I promised initially that is we would be using this image which we have created and creating a kubernetes pod in mini queue if you are finding value in this video give it a thumbs up it really makes a huge difference many Q is installed on your laptop please check the status whether it is running or not it is not running mini Cube start is the command to start the mini Cube so once uh minicube is up and running let us create a pod using newly created image command is qctl run and give a name of your pod so let us call it as a demo nginx just let us copy from here and let us remove the docker pull after that let us give a port we want it to run this particular pod on Port 80. so if you could see it has been created let us say get parts so if you see our demo nginx is running so in order to access this but you need to create a service for that command is Cube CTL Expo sort name of the service let us see demo nginx SVC stands for service let us use the port as 80 our engineering service is created in order to access our application from our laptop so what we are doing is a port forward for our service that is from 7080 I will try to access it will follow the request to our service and services forwarded to our pod so let us run this now let us access localhost 7080 so if you could see our engine access running and you could see index.html has been updated but remember I have copied our index.html from this particular path this particular data had taken it same thing you are able to see it over here
Info
Channel: beginner.academy
Views: 30,573
Rating: undefined out of 5
Keywords: DevOps, cloud, TechWorld with Nana, Simplilearn, KodeKloud, how to create to docker file, How to create a repository in the docker hub., how to create a docker image from a docker file, How to push docker image into the docker hub, simple step to create a pod in the Kubernetes, How to push docker image, docker tutorial, docker tutorial for beginners, docker for beginners, dockerfile, learn docker, getting started with docker, freecodecamp, kodekloud, techworld with nana, pluralsight
Id: 95zmJnz4iOo
Channel Id: undefined
Length: 7min 0sec (420 seconds)
Published: Tue Nov 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.