docker: Error response from daemon: failed to resolve reference "[docker.io/library/hello-world:latest](http://docker.io/library/hello-world:latest)": failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: 401 Unauthorized.
Most of my students can do ādocker run hello-worldā immediately after installing docker Desktop but some get the ā401 unauthorizedā error message. I found that these students need to do ādocker login -t ā and then thy can do ādocker run hello-worldā
After I installed Docker Desktop on a new MacBook, I got a similar response when running ādocker run -d -p 8080:80 docker/welcome-to-dockerā. Based on the infos in this thread I then tried ādocker login -u my-user-nameā (using my real username) and after that the error went away, the image was retrieved and it ran as expected.
So both of you had this in Docker Desktop. I could not reproduce it until today. Since I used Docker Desktop on macOS and Windows at the same time, I donāt remember on which one I had the issue, but In my case I had to log out actually. Then pulling images worked even when I logged in again. Non of the images you mentioned here require authentication and neither does the alpine image I tried, so it must be a bug which I think so far I only saw in Docker Desktop.
update:
I heard that it happened before and at that time it was confirmed to be a Docker Hub issue. I guess it can happen occasionally and until it is permanently fixed (if it is possible), we can log in or log out which seems to solve the issue.