Why do I get an authorization error from Docker when I'm trying to pull a public image?

Docker for Windows --

repro docker pull redis

I received this error recently. My solution turned out to be doing a docker logout, which seemed to clear the credential entry slot related to docker hub (speculation). After this, my docker pull redis worked fine.


This issue could be caused by being signed into Docker on your machine.

Signout of Docker, the following screenshot is from a Windows machine, you see will a Signout option if you are signed in.

enter image description here


It turns out that Docker checks authentication before it checks what permissions are needed for the image in question.

Thus, if you have bad auth details in ~/.docker/config.json, your request will be flatly rejected. Fix or remove the bad record and you'll be good to go!