Docker login to Github packages from Codespaces gives access denied

20 Views Asked by At

I am working in Github codespaces and I want to login to github packages.

The below way is working from my laptop, but when I try to login from Codespaces I get Error response from daemon: Get "https://ghcr.io/v2/": denied: denied

export GH_TOKEN="<github-personal-access-token>"  
export GH_USER="user-name"
echo "$GH_TOKEN" | docker login ghcr.io -u "$GH_USER" --password-stdin
1

There are 1 best solutions below

0
Vincent Claes On

On Github Codespaces use the predefined environment variables in your command:

echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdin

To see all the environment variables run env | grep GITHUB