Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error response from daemon: Get "https://ghcr.io/v2/": denied: denied

While using with the GitHub action I am getting Error response from daemon: Get "https://ghcr.io/v2/": denied: denied

I used the login command echo $CR_PAT | docker login ghcr.io -u $ghcr_user -password-stdin

enter image description here

like image 525
Neeraj Singh Negi Avatar asked Dec 05 '25 14:12

Neeraj Singh Negi


1 Answers

I believe the command you want should be:

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

That adds quoting to the variables and a second dash to the long arg. It also assumes those variables are defined.

That said, I tend to use the following in GitHub Actions for doing the login:

​    - ​name​: ​Login to GHCR 
​      ​uses​: ​docker/login-action@v1  
​      ​with​: 
​        ​registry​: ​ghcr.io 
​        ​username​: ​${{ secrets.GHCR_USERNAME }} 
​        ​password​: ​${{ secrets.GHCR_TOKEN }}
like image 143
BMitch Avatar answered Dec 07 '25 12:12

BMitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!