Docker Push Repository
We can push our Docker image to global repository. It is a public repository provided by Docker officially. It allows us to put our docker image on the server. It is helpful when we want to access our docker image from global. Follow the following steps to push custom image on the Docker hub.
- login to hub.docker.com
- Tag Docker Image
- Push Docker Image
We need to login to our account of Docker hub. If you don’t have, create it first.
It will ask for username. Enter the dockerid here and press enter.
After providing username, it asks for password. Enter your account password here and it will show you your login status as succeeded.
After login, we need to tag our docker image that we want to push. Following command is used to tag the docker image.
username refers to our dockerid or the username which is used to login.
image-name is the name of our docker image present on our system.
See, screen shot of the above command.
In the above command, we have tagged docker image hello-world. Now, we need to push it to the repository. Let?s see it in the below command.
The following command is used to push docker image to docker hub repository.
See, screen shot of the above command.
In the above screen shot, we can see that docker image has been pushed successfully.
Now, login into our account at hub.docker.com and check our dashboard. It will have a new docker image named dockerid4irfan/hello-world.
Look at the screen shot, it has the newest one docker image which is just pushed. On the top, the first one is the newest image.