I just re-installed Docker Desktop on my Macbook Air after a few months of exclusively using Docker on remote machines using VS Code and ssh.

I was puzzled to see a 403 coming back when pulling an image from ghcr.io, which obviously is an open registry:

$ docker pull ghcr.io/astral-sh/uv:latest
Error response from daemon: failed to resolve reference "ghcr.io/astral-sh/uv:latest": failed to authorize: failed to fetch oauth token: unexpected status from GET request to https://ghcr.io/token?scope=repository%3Aastral-sh%2Fuv%3Apull&service=ghcr.io: 403 Forbidden

Turns out that docker login credentials survive when you uninstall Docker Desktop, and an ancient (now expired) GitHub token was being used in the above request.

Running docker logout ghcr.io solved it.

I didn’t find any good results when Googling this issue, and the error message isn’t very descriptive, so I thought I’d post it here.