Today I Learned: authenticate to ghcr.io registry

In order to pull docker images from private repos you need to authenticate to docker registry first.

  1. Create PAT (Github’s Personal Access Token) - classic

Create classic token - https://github.com/settings/tokens

Token scope just for pulling images:

  • read:packages
  1. Export token
export CR_PAT=YOUR_TOKEN
  1. Authenticate
$ echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
> Login Succeeded

Links: