w hat is DockerHub?? Dockerhub is cloud storage, which is used to store the docker images from anywhere and use the image anywh...
what is DockerHub??
Dockerhub is cloud storage, which is used to store the docker images from anywhere and use the image anywhere using Docker.
Pushing the Image to Dockerhub:
To Push the local docker image to the docker hub we need to do some steps.
Step1: Login to the docker. hub from the command line
Command: docker login --username=yourhubusername
Example:
Step2: Check the available docker images:
Command: docker images
Step3: Now the docker image won’t have a tag so need to set the tag for the image.
Here I am going to move the react-nginx image to my docker hub.
Command: docker tag 4853aafa83ff yourhubusername/repositoty name:anyword
Example: docker tag 4853aafa83ff username/react-nginx:firstdocker
After executing the above command check the docker images list.
Step4: Now need to push the docker image to the docker hub.
Command: docker push dockerhubusername/repositoryname
Example: docker push 12041995/react-nginx
Step5: Now need to check the docker hub repository from the browser.
Click the repository--> go to settings --> click make private
Pulling docker image from DockerHub:
Now I am going to pull the docker image from the docker hub
Example: Here, I am going to pull the httpd Docker image.
Now, we have successfully pushed the local docker image to the docker hub and changed it to private, and pull the image from docker hub. ------------------------------------------!!!Happy Learning With Techiev!!!! ---------------------------------------