How to create a docker image and push it to the docker hub on AWS EC2 | Docker Hub QuickStart

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone welcome back to my channel this is sambhu from cloudtech today we'll talk about how we can use Docker Hub to store our Docker image and how we can like pull the images from the docker Hub and how we can push the images to the docker how by using AWS 62 instance so for that what we have to do first we have to create a account with this Docker Hub so I have already in this dockara page so if you just Google search like Docker Hub like this let me show you hub so it will very first link will come this one so just click here is the sign up for free and it's a complete open source and as well as the Enterprise version also available so today's demo like I will talk about like open source one and what the advantage here is like since it is open source and free right if we are storing our images to the like AWS ECR right then there is a charges is there right but if you would like to use the free right then you can utilize this Docker that's the one advantage and disadvantage I can say and another thing is like this is like a container like a what I can say container manager right so here we are storing our image like all this thing right so let me show you how we can create the account here let's give here let's give the username select the bosses here start right so let's sign up so now we are logged in here this is our user and here the I was talking about there is a Enterprise version as well as 317 so free version there is a limited uses and for Enterprise there are multiple add-ons some users is there like how many image you can post unfold for per day like that is there and here also in this Docker engine you can integrate with the kubernetes also in my why I came this topic today is because in my next subsequent video I have a plan to show you like AWS eks and in that I am planning to use like how from Docker how how we can use the docker Hub image to deploy that eks container or maybe from ECR how we can take the image to deploy the eks controller okay guys so that's the why I have to before go to the AWS cks I thought okay let's give that uh little thought about how we can use okay guys so this is the one so let's select that three tires one here continue with free now here it is asking please verify your email address so let me verify my email address I have already my mobile so um scan already so like this it will come so you you have to click on that so just verify even so it's kind of like confirmation is there like a correct pupil or not or is the right email address or not right so that's the purpose of hold this one so successfully verified so just if you see successfully verified just a reset refresh this page your email has been verified okay guys now here either you can use the browser version or you can download the docker desktop Docker Hub desktop and that also you can and that to be available so today's session let's use the browser one only and let's try to create a registry and then try to push our emails Okay so this is our register name let's give that and here the two options one is the public another one is the private okay guys so repository name I give clouded let's create here so our image is created right so the repository is created this is the place we can uh like we can post our image okay guys so how we can post image so now for that what we have to do we have to first launch one ec2 instance on the dc2 instance we will configure the how we can use Docker okay guys so I have already running one ec2 instance in my previous session I already demonstrated how we can use like a Docker on a ec2 instance and all the step I have mentioned there I will give that link to this video description today I will just or this is the uh instances running where every Docker all the setup is there so for this today's session I will just quickly show you what all step we need to follow to configure the docker in AWS e suit instance okay guys and I will give those all the comment to this video description so that it will be helpful to you guys so let me show you quickly what all step we need to follow so if you are in AWS issued instance first we have to update that then you have to install the docker then we have to give the user mode and then we have to set this one then we can enable the docker service and we can start the docker and then we can check the docker status also and finally you can check the docker function once it is done then we can create our image image means or if you would like to create image right then what we need basically a high level I am just giving for more details I would request you guys to refer my previous video where I have demonstrate how we can create Docker image all this thing okay to create a Docker image we need the docker file and in the docker file we can give like where the entry point or what you would like to start right so now for this images I am using like ngx and uh and here I am using that index.html which uh I am deploying so what it's content basically index.html like a title and simple HTML page and the welcome to the cloud Tech this is a simple web page for Docker ECR research and EK HTM okay guys so this is what we have and here I am just run command I am giving this permission and if you have any python or anything then you have to specify here like entry point Python and what from where you want to start okay guys something like that so I today's session we have only HTM so let's keep this one and once it is done right so what we need to do we need to build the docker image this is the command and you can tag that image this is the command and then we can run that image so let me go one by one so let's go to the docker so here I have this is my ec2 instance which is running right let me show you that or iPad is 206 right so let me show you that 66 right this is my instance where it is running and all the step whatever's command I have showed you just now right everything I have already installed here so let me show you that this is my darker version okay let me check what all images we have here so here already I have that static web app what I was talking about right so let me show you that so this is my Docker file what it is content let me show you that vdi so this is the content what I just now I showed you in that uh that the hot icon code a Microsoft Visual Studio code so same thing we have and here index.html let me show you that also here this simple HTML tag okay now what I have done here we can build the docker image so how we can build let me show you that command so this is the darker build hyphen T and what image name you would like to give so that image name we can give here like this we can build so any name you can specify your let me show you that something like that so it is built successfully let me show you that image is there or not so if you see right here is our image Cloud type demo right and if you would like to start this email right so let me see like if if any image is running or not these are the basic command this is the image is running right already so what we can do we can stop also how we can stop stop and then image ID what container is running right that container I do have to specify now it is stop let me show you that Docker PS no images now what we will do whatever image just now we created right this image will run so how we can run so let me show you the Run command this is the Run command and here I can give them my image run and then which Port you would like to run so that Port also we have to specify so by using that quote only we can access our application whatever application we are running in this Docker Docker okay guys so this is my image so let me run here now see dockerps see this is running and if I try to it's a simple static web application right so if I hit just uh by Carl command then I should able to accelerate so let me see see I am able to access this one right so even I if I hit that instance uh DNS address also I can able to access it let me show you that this is like a not a https so let me remove this so it is loading okay still it is an https so remove this see whatever we have given in the HTML page right so same thing it is coming here now how we can push this image to Docker uh Docker Hub here right now if you see here we don't have any image right so to push this image what we need to do we need to Docker push then Cloud Tech tag this is the command we have to follow so for that what we need to do we need to tag the image like this okay guys so let me show you that let's first add the image how we can text so tag the image so tag command already I have specifically written here so Docker tags but today's uh our case we need to change this one this is uh the image was there that time so let's tag this image here and now let's go here I will give all this command to this video link description so that it will helpful to you guys to occur now we can see Cloud Tech Cloud takes something like that image you can see here right now we can push this image to our registry how we can push so let me come here this is the command is mentioned right Docker push and attack whatever tag you would like to push right so in our case tag if you see here you can check the tag which tag is there so this is our tag so you can copy and Docker push now here it's giving access denied why because because that particular resistor we don't have access so for that what we need to do first we need to log into that particular register what how we can login blocker login U then what our user IND is our user right Cloud tag IND and it will prompt us to password also so let's give the password now we are able to successfully login now let's try to boost and then our image now we can see now it is pushing so it's pushed already now if you see darker yes okay so now let's go to the console and just refresh this one you can able to see here common image is boosting in the Repository see now is image right latest and post now if you would like to get this image in your local directory how we can get it let me show you that too also here we have the worker images okay [Music] let me remove this image search Okay image ID we can give registry right so let's give the image ID corresponding search container oh my God yes button so let's remove this energy running container okay let me stop this first stop try to remove then let's try to remove such container while it is not removable okay do one thing so this is the image right so what we can do like um it's not deleting image okay Docker image command is wrong okay that's why it is not removing now it is removed right now check the docker image now this image is gone right now let's try to pull that image [Music] that image and image tab right so Docker pull what you want to pull that so that you can get it from here so this is our image let's see here dentist now it is full right so worker now check images now we are able to see our image here see here it is not there Docker image I just now removed then I pull from Docker so what the benefit here is like you can maintain your image like it's a kind of GitHub right in GitHub we used to maintain our code right our source code wish to maintain in GitHub or gitlab right in AWS like uh we have like code commit uh that repository we have right so similarly in open source we have like if you would like to maintenance your images right then you can use this Docker Hub where you can kept your images okay guys so I hope this will helpful to you guys and if you like this session then I would like request you guys to this do like share with your friend and please subscribe my channel that will really Inspire to me and I will come up my next subsequent video like I have a plan to give you one more demo like in my next chat GPD with Lambda so I am coming there demo you know guys uh the chat GPD is like a very hot uh uh Topic in today's Tech stand right so that's why I thought okay let's come some uh some some AWS with charged how we can integrate so in my next subsequent video I will talk about and then I will talk about next subsequent video Docker with eks okay guys so that already all the setup I have done so I will do my next subsequent video okay guys if you like this video then please like share and subscribe my channel that will really Inspire to me and I will see you guys in my next subsequent video ciao bye
Info
Channel: CloudTech AWS & Azure & GCP for Everyone 🤝
Views: 258
Rating: undefined out of 5
Keywords: EC2, ECR, ECS, DOCKER, S3, Computer Application, How to push image to docker hub, push an image to docker hub, how to pull image from docker hub, Docker Hub Quickstart, how to push an image to docker hub, how to create account in docker hub, how to create docker image and push to docker hub, how to create docker hub account, docker image push to docker hub, sudo systemctl enable docker.service, deploy docker container to aws, aws docker, deploy docker image to aws ec2
Id: 10DZE1hKLG4
Channel Id: undefined
Length: 18min 39sec (1119 seconds)
Published: Fri Aug 25 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.