Pushing Image to a Central Registry

Navigate to Docker Hub and create a free account if you haven’t already.

1. Log in to the Docker registry account from your terminal:
         $ docker login

2. Tag the image with your username. As per Docker Hub naming convention, tag your previously created image python-hello-world in following format [dockerhub-username]/[image-name]

Syntax 
$ docker tag python-hello-world [dockerhub-username]/python-hello-world 
Ex $ docker tag python-hello-world ashishseth/python-hello-world

3. Push your image to the Docker Hub registry

Syntax 
$ docker push [dockerhub-username]/[image-name]  
Ex:- $ docker push ashishseth/python-hello-world [here ashishseth is username]

4. Check your image on Docker Hub in your browser.

Login to Docker Hub and see your uploaded image in your profile. If it is available then other developers and operators can use the “docker pull” command to deploy your image to other environments. They are no longer need to worry about environment drift (version differences) when you rely on dependencies that are installed on every environment you deploy to. Docker images contain all the dependencies that they need to run an application within the image.