'Logging into GitHub Container Registry fails with HTTP/HTTPS error [closed]

I'm trying to push a container to GHCR that I've built with Docker locally. GitHub's documentation suggests that I put a Personal Access Token (PAT) with appropriate permissions in an environment variable and then have Docker log into GHCR like this:

$ echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin

My username is correct, $CR_PAT is definitely in the environment and being returned from the echo request. My token has the write:packages and read:packages permissions GitHub recommends. And yet when I run the above, it fails with:

Error response from daemon: Get https://gchr.io/v2/: http: server gave HTTP response to HTTPS client

Putting this string into Google finds no exact matches, and the only hits are talking about private registries. Which isn't relevant, I don't think, since I'm trying to use GCHR.

I'm on macOS 10.15. I'm running Docker 20.10.5, installed using Docker Desktop.

What am I missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source