Red Hat Bugzilla – Bug 1309739
docker push fails when pushing image to docker hub
Last modified: 2016-05-12 11:17:15 EDT
Description of problem: docker logging fails when pushing image to docker hub: [root@openshift-112 ~]# docker push docker.io/deshuai/hello-openshift:v1 Do you really want to push to public registry? [y/n]: y The push refers to a repository [docker.io/deshuai/hello-openshift] (len: 1) f7591c834e4d: Image already exists 0a9b9b6b06fb: Preparing unauthorized: access to the requested resource is not authorized 2. Some error log in docker demon msg="Handler for POST /v1.21/images/docker.io/deshuai/hello-openshift/push returned error: Error: Status 403 trying to push repository docker.io/deshuai/hello-openshift to official registry: needs to be forced" msg="HTTP Error" err="Error: Status 403 trying to push repository docker.io/deshuai/hello-openshift to official registry: needs to be forced" statusCode=403 Version-Release number of selected component (if applicable): docker-1.9.1-16.el7.x86_64 How reproducible: always Steps to Reproduce: http://fpaste.org/324435/62955145/ Actual results: Pushing image to docker hub fails Expected results: Pushing image to docker hub works. Additional info: Changing docker.io to https://index.docker.io/v1/ in config.json solve the problem.
Avesh, can you 'cat' $HOME/.docker/config.json? (be aware, hide the auth token pls)
{ "auths": { "docker.io": { "auth": .., "email": "dma@redhat.com" } } } And changing docker.io to https://index.docker.io/v1/ solved the problem
Alright, thanks Avesh, this is definitely fixed in docker-1.10.x An attempt was made to backport the fix to 1.9.x (https://github.com/runcom/docker/commit/c561d441a8a268a87be15ea19829b0dff56da35d) but it didn't make into the code base (even if it's shown merged)
*** Bug 1300808 has been marked as a duplicate of this bug. ***
The docker version in latest RHEL/centos has this problem still. docker-1.9.1-25.el7.centos.x86_64 docker-1.9.1-25.el7.x86_64 ``` [root@cloudhost ~]# docker push docker.io/dustymabe/bb Do you really want to push to public registry? [y/n]: y The push refers to a repository [docker.io/dustymabe/bb] (len: 1) 307ac631f1b5: Image push failed unauthorized: access to the requested resource is not authorized ```
we merged https://github.com/projectatomic/docker/pull/130 which fixes this bug. Will rebuild docker 1.9 for rhel.
In docker-1.9.1-38.el7.x86_64, # docker login Username: timesu Password: Email: WARNING: login credentials saved in /root/.docker/config.json Login Succeeded # docker push docker.io/timesu/busybox Do you really want to push to public registry? [y/n]: y The push refers to a repository [docker.io/timesu/busybox] (len: 1) 307ac631f1b5: Pushed 4b51ded9aed1: Pushed latest: digest: sha256:293ee253bd4949e2ef7e4437337543cc8132dd9abc2f4899df01b96508f87236 size: 2738 Move to verified
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-1034.html