Skip to content

unauthorized: unauthenticated: User cannot be authenticated with the token provided. #50035

Discussion options

You must be logged in to vote

I found the issue:

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

in https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry

Should be:

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

Note sudo in the latter command.

With the first command, ${HOME}/.docker/config.json is populated but not picked up by sudo docker push ghcr.io/c-scale-community/hello-world

With the second command /root/.docker/config.json is populated and correctly picked up by sudo docker push ghcr.io/c-scale-community/hello-world

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sebastian-luna-valero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Packages Host your dependencies, libraries, and production-ready code, right from your repository Question
1 participant