While pushing the docker image (after successful login) from my host I am getting \"unauthorized: authentication required\".
Details below.
-bash-4.
There has already been good answers but I would like to mention one - You do NOT need to create a repository in advance before pushing it.
The problem for me was that I didn't set the correct username of the account I logged in to. But once the correct username is set before the image (e.g. YOURNAME/YOURIMAGE) via its tag, you can push it without creating a new repository in advance.
sudo docker tag IMAGE:VERSION USERNAME/IMAGE:VERSION
sudo docker push USERNAME/IMAGE:VERSION