You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pull private or internal docker image from ghcr.io
docker pull ghcr.io/<org>/<repo>:latest
Expected vs actual behavior
It's expected that the tokens generated via gh auth (given the read:packages scope) will be able to docker pull images that have private or internal visibility -- this is the case for PATs.
Instead the following error is produced Error response from daemon: unauthorized.
Reacted by Max Ekman, Oscar Söderlund, John McGrath, きわみざむらい and Andrew Tec
@xzyfer I ran into the same issue, and for me it was that the GHCR images were stored in an SSO-protected organization. It might be that gh auth login needs to support SSO authorizing the generated token.
Ah, so, I've learned something today: for docker login ghcr.io you can only use Personal Access Tokens that you manually generate and additionally SSO for your org. Right now it seems that you cannot use the token produced by gh auth login since that's technically an OAuth token (and not a PAT). 🤔
I will ask internally whether this restriction is intentional or not.
Activity
maxekman commentedon Feb 7, 2022
Would love to see this solved!
odsod commentedon Feb 7, 2022
@xzyfer I ran into the same issue, and for me it was that the GHCR images were stored in an SSO-protected organization. It might be that
gh auth loginneeds to support SSO authorizing the generated token.xzyfer commentedon Feb 7, 2022
I can confirm new do not have SSO. Other authenticated operations via gh work fine. The issue appears to be related specifically to ghcr's auty model.
mislav commentedon Feb 7, 2022
Ah, so, I've learned something today: for
docker login ghcr.ioyou can only use Personal Access Tokens that you manually generate and additionally SSO for your org. Right now it seems that you cannot use the token produced bygh auth loginsince that's technically an OAuth token (and not a PAT). 🤔I will ask internally whether this restriction is intentional or not.
mislav commentedon Feb 8, 2022
This is not resolved, but I'm going to fold this into #5150 so we have a single issue to track Docker authentication stuff.