Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker access to the requested resource is not authorized

Tags:

docker

I have ubuntu 14 and have installed docker 1.8.3. Unfortunately I have this error:

sudo docker login
Username (mauriziobioinfo): 
WARNING: login credentials saved in /home/maurizio/.docker/config.json
Login Succeeded

sudo docker push   mauriziobioinfo/varscan
The push refers to a repository [docker.io/mauriziobioinfo/varscan] (len: 1)
ec3a068ba18d: Buffering to Disk 
unauthorized: access to the requested resource is not authorized
like image 230
user4249654 Avatar asked Oct 19 '15 14:10

user4249654


People also ask

Can't push to Docker hub denied requested access to the resource is denied?

As the error says requested access to the resource is denied error which means you as a docker user do not have the correct rights/permission to run the docker push or any other docker command. Or you are not using the docker hub credentials correctly.

How do I push a docker image into repository?

To push an image to Docker Hub, you must first name your local image using your Docker Hub username and the repository name that you created through Docker Hub on the web. You can add multiple images to a repository by adding a specific :<tag> to them (for example docs/base:testing ).

How do I log into Docker hub from command line?

To run the docker login command non-interactively, you can set the --password-stdin flag to provide a password through STDIN . Using STDIN prevents the password from ending up in the shell's history, or log-files.


3 Answers

The solution for me was to run "docker login" before the command. So I logged in and then pushed.

like image 50
Edwin van Zon Avatar answered Oct 13 '22 08:10

Edwin van Zon


I had a similar error message using a repository on quay.io specifically. I had to mark the image as public even after a docker login quay.io command. It was an odd error and an odd solution since I had permissions to the image.

like image 9
designatevoid Avatar answered Oct 13 '22 08:10

designatevoid


Things to troubleshoot:

  1. docker login must be executed before a docker push username/repository:tag command.

    The docker push is not that automatic that it would give a different error message when not being logged in (or that it even would prompt for login on itself)

  2. Double check your username in the push command line
  3. Create the repository in the docker web-interface
  4. Double check that the repository name in the push argument matches an existing one

    That means search for it under:

    https://hub.docker.com/u/$username/
  5. Move an existing /root/.docker/config.json out of the way in case it is broken. Then, re-execute docker login.
  6. Check the API URL in /root/.docker/config.json. For example, with some docker versions (e.g. 1.8.1/1.9.1) you have to replace docker.io with https://index.docker.io/v1/
  7. If you execute some docker commands with sudo then make sure that all of them are executed with sudo (e.g. check if alias docker returns a definition)
like image 5
maxschlepzig Avatar answered Oct 13 '22 07:10

maxschlepzig