Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error unauthorized: HTTP Basic: Access denied on docker push registry.gitlab.com

I have error with:

docker push registry.gitlab.com/user/rep-name

The push refers to repository [registry.gitlab.com/user/rep]
f319ccdf8ee4: Preparing 
..
7032a7172c0a: Preparing 
b16cd70f3a2c: Waiting 
...
unauthorized: HTTP Basic: Access denied

But prev login is Succeeded:

docker login registry.gitlab.com
Username: user
Password: 
Login Succeeded

Docker ver:

docker -v
Docker version 19.03.8, build afacb8b7f0

I use Personal Access Token is "api" https://gitlab.com/profile/personal_access_tokens

because I have 2-factor athorization.

like image 584
mpz Avatar asked Apr 13 '20 22:04

mpz


1 Answers

I change:

  • Personal Access Token scope: https://gitlab.com/profile/personal_access_tokens to "api" and "read_registry"

  • usename in docker login from @user to [email protected]

now it is works.

Seems issue is in "read_registry" scope. And it is strange because "api" also have read access. From Gitlab:

Grants complete read/write access to the API, including all groups and projects, the container registry, and the package registry.

like image 94
mpz Avatar answered Oct 03 '22 21:10

mpz