Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
4 views
by (2.3k points)

How to push a docker image to docker hub?

1 Answer

0 votes
by (6.9k points)
edited by

First you will need to create a DockerHub account, once you are done with that login to your account through the terminal of the system where you are working with docker, use the below command:

$ docker login --username=yourhubusername [email protected]

You will get the below message on successfull login:

WARNING: login credentials saved in /home/username/.docker/config.json Login Succeeded

Now use the below the command to list down all the images present in your system:

$ docker images

Find the image you want to push to dockerhub and then tag it using the below command:

$ docker tag bb38976d03cf yourhubusername/custom_image:latest

Here make sure that you tag your image in such a manner : 

<your_Dockerhub_user_name/name_of_the_image>

Then you can push your image using the below command:

$ docker push yourhubusername/custom_image:latest

Then go ahead and check your dockerhub, you should find your custom image uploaded to it.

Hope this helped :)


If you are looking for resources to study from or any help from a trainer try the docker training course.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Mar 20, 2020 in DevOps and Agile by chandra (29.3k points)
+1 vote
1 answer
0 votes
1 answer

Browse Categories

...