How to Push and Pull a Docker Image from Docker Hub

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and now in this video we will see how we can push the image to the docker Rob ok so uh these are the some of the steps which we have to follow to push the whatever we create the image for the docker okay as uh it will be very beneficial suppose if you want to send some code or some part of like some of your project to someone else which works on a particular uh environment suppose that project works on python 2.6 only okay so then you can create the image of that and then you can send it to your friend or now you can post it on the docker Hub and from there your friend can access it okay so this is the very uh simple process so for that first of all you will need to go on this particular website that is Docker hub it means like hub.docker.com okay and here if you don't have any account then for that you will need to register first it's very easy process to register actually I have already a account on it so what we can do I will just sign up sign in here so this is the username which is required to push the image to the docker up okay So currently we are here on the dashboard okay so now what we will be doing uh like we had created the image that is calci okay and now but uh we can do uh we will create one more image uh for this project okay that sample.java okay we have already the docker file here we had done it in our last video okay so this is the docker file so what we will do we will basically create one image okay so how we can do it it's a very simple Docker build hyphen T okay and the name which you want to provide suppose I want to provide its name to calculator Java okay this time I want to provide and you have to just use Dot okay so you can see image is being created now if you'll search for Docker images so here you will see calculator Java has indicated and the tag is latest because we had not provided any kind of tag to it that's why it's showing latest okay so just uh clear the screen and again I'm let me just search okay so this is the image has been created okay so now here if you will check uh here you will see like the whatever the image we create we don't provide the actual the format of that so we need to change the format using this command like Docker tag and whatever the image name if version is present then we write the version name and then the uh the name in The Format in which uh through which we can post that image to the docker okay so that how we can do let's see so it's uh just you have to provide Docker and then you have to provide the tag and the name of the image which you have created so here the name is calculator Java okay so Cal queue later Java okay and the name will be followed by your username so my username is 987456 Slash and whatever the name which you want to give suppose I want to give it as a calculator and I will provide the version so I will provide the version ml version 1.0 okay let's hit enter and now if you will again search for Docker images you will see one image has been created with the name and the tag is version 1.0 okay so now what you will need to do uh you will need to just uh do Docker login okay to push that image to the docker so Docker login is required okay so here it is showing me like I'm already uh authenticated here okay so if I will open up some new terminal and if I will search here Docker login okay it's already uh my account is already authenticated that's why it's not asking me for the user when password but when you will do it it you will need to enter your username and the password okay so it's fine uh now what I will do the last command which we'll use is Docker push and whatever the image name which we have so we have this image name we will need to copy this hole okay so okay push and the version in which you will need to provide it and the version name is uh version 1.0 okay so here we're done so the post refers to repository this so it will now push our project to on the docker drop okay let's wait it will take some time uh so it's soft 3 23.6 MB okay so here you can see it is showing me mounted from ayush disk calcium okay so is there also any no actually I had already pushed one image with the same name for the testing that so it's showing that so till the completion I just pause the video okay I will come back when this will complete here you will see now it is pushed okay so if you will check here uh if we reload this okay so here we you will see uh one image is pushed here okay and this is the same name which we had given like calculator app okay and if you click on the public view you will get to know how you can pull this image okay so this is the command which we use to pull the image actually okay so that is the simple one okay so uh you might you might get confused why mounted and all so to clear all this uh if you want to you can give it like this colon and then version 1.0 but now I don't want it just a hit dot okay so let's just clear the screen if you'll check for Docker images so here you will see this one I used this this okay oh sorry not this one yeah here we have hello python okay so this is created now we can just push it using Docker push and the name which we have is uh iOS 987456 slash hello python okay so here you can see it is preparing and waiting it will take some time okay okay it is now taking all the from library python fine okay I just pause okay and we'll wait I just pause okay so here you can see it is just pushed all those things if you will check again on the repositories here in this section and here you will see Hello python is there and if you click on public View so this one is the command which will be you using okay so now what we will do I just go into the dark images and I just remove this one uh Docker RMI remove image and the name of the image should be okay okay now removed if I can check okay fine there is no images so now what we can do uh where is the yeah instead of RMA we can do not pull okay so now it's pulling the resource from the docker up okay status downloaded if you will again check for Docker images so you will see we have this one and if you want to run you can run it using Docker run and the control V if you do this one and the here you can see the content whatever the content we had written uh it's showing us here if we'll check app.pi so this is the this is first image current director is printing and the all the files which are present there okay so in this way you can push the image to the docker you can pull the image from the docker up okay and also this will help you to like um what we say you can easily share your project to other person as well okay so that's it for today's videos guys I hope you liked it okay if you have any queries you can ask in the comment section that's all food reviewed and I'll meet you in the next video thank you for watching
Info
Channel: ProgrammingKnowledge
Views: 41,497
Rating: undefined out of 5
Keywords: docker start ubuntu container bash, run ubuntu docker image on mac, run ubuntu in docker on windows, docker run ubuntu latest, docker run ubuntu image interactive, docker push denied: requested access to the resource is denied, docker push image, docker push image to private registry, docker hub login, docker tag and push, docker registry, docker image, docker build and push in one command
Id: f2sDOaOzKPM
Channel Id: undefined
Length: 9min 48sec (588 seconds)
Published: Tue Apr 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.