Upvotes 1 Share PDF

Docker fails to push to DTR and requests authentication

Overview

The docker push command fails and requests authentication when pushing to DTR.

Symptoms

docker login dtr.example.com
Username: <user>
Password: <password>
Email:
WARNING: login credentials saved in /home/username/.docker/config.json
Login Succeeded
<user>@docker ~ $ docker tag hello-world dtr.example.com/hello-world
<user>@docker ~ $ docker push dtr.example.com/hello-world
The push refers to a repository [dtr.example.com/hello-world]
5f70bf18a086: Preparing
b652ec3a27e7: Preparing    
unauthorized: authentication required
<user>@docker ~ $ docker tag hello-world dtr.example.com/dev-test/hello-world
<user>@docker ~ $ docker push dtr.example.com/dev-test/hello-world
The push refers to a repository [dtr.example.com/dev-test/hello-world]
5f70bf18a086: Preparing
b652ec3a27e7: Preparing
unauthorized: authentication required
<user>@docker ~ $ docker push dtr.example.com/<username>/dev-test/hello-world
The push refers to a repository [dtr.example.com/<username>/dev-test/hello-world]
5f70bf18a086: Preparing
b652ec3a27e7: Preparing
unauthorized: authentication required

Resolution

When pushing to a DTR server there are two things to keep in mind:

  • DTR requires a namespace.
  • The repository must be created in the UI (and have the proper permissions set) before a push is allowed.