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
On Github Codespaces use the predefined environment variables in your command:
echo "$GITHUB_TOKEN" | docker login ghcr.io -u "$GITHUB_USER" --password-stdinTo see all the environment variables run
env | grep GITHUB