1

I want to check if a container on gitlab is built properly with the right content. As a first step, I'm trying to login to the registry by running the following command:

sudo docker login -u "ci-registry-user" -p "some-token" "registry.gitlab.com/some-registry:container"

However, I run into Get "https://registry.gitlab.com/v2/": unauthorized: HTTP Basic: Access denied errors.

My question is in two folds:

  1. How do I access the hosted containers on gitlab? My goal is to access the container and run docker exec -it container_name bash && cat /some/path/to_container.py
  2. Is there an alternative way to achieve this without logging in to the registry?
theSekyi
  • 462
  • 2
  • 6
  • 23

1 Answers1

2

Check your GitLab PAT scope, to make sure it is API or at least read_registry.

Read-only (pull) for Container Registry images if a project is private and authorization is required.

And make sure you have access to that project with that token, if thesekyi/paalup is a private project.

Avoid sudo, as it changes your environment execution from your logged-in user to root.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • [This question](https://stackoverflow.com/questions/57971539/check-scopes-of-personal-access-token-from-gitlab) says this feature is no more available. Do you know any other way I can check my PAT scope? – theSekyi Jul 10 '22 at 06:27
  • @theSekyi In that case, it is best, for testing, to create a new PAT with the right scope. – VonC Jul 10 '22 at 06:28