Unable to push images to gitlab container registry with error unauthorized: authentication required

Logging in succeeds

root@sc-gitlab-ci-1:~/test# docker login registry.gitlab.com --username $username --password $password
Login Succeeded

However pushing fails:

root@sc-gitlab-ci-1:~/test# docker push registry.gitlab.com/jonathan-kosgei/saharacluster/test-nginx
The push refers to a repository [registry.gitlab.com/jonathan-kosgei/saharacluster/test-nginx]
1bbf5c4f940b: Preparing 
b36519590516: Preparing 
da85d9b33770: Preparing 
4fe15f8d0ae6: Preparing 
unauthorized: authentication required

I'm using gitlab.com with docker 1.12 on a specified runner for the project.

There have been many references to this problem in many issues, however all are pre-emptively closed with a reference to a patch on docker or gitlab. I believe that would apply more to users running self-hosted instances of gitlab where I'm simply testing out the service on gitlab.com . Any help will be appreciated, it's pretty frustrating not to be able to use a feature that I would need and use almost every single day.

Assignee Loading
Time tracking Loading