0
votes

I have a Gitlab Repository that hosts a web app made with React / NodeJS, So, I have the client and server in the same repo.

App is working, and I want to use Gitlab Registry my Docker images (client and server).

Thing is my repository has the name: gitlab.com/group/project

And it is expecting a Docker image with the same name.

Instead, I have two Docker images:

  • registry.gitlab.com/group/project_api
  • registry.gitlab.com/group/project_client

So, it won't let me push my images. I get:

denied: requested access to the resource is denied

How can I do it ? I don't want to make two repositories.

1
Ah, you are trying to push them to the same registry. You could use different tags, but it is not recommended - it is more standard to create two GitLab projects. The syntax for using tags would be gitlab.com/group/project:api (and :client for the client, obviously).halfer
In general the tag is for versions, so to use them for two separate streams of work is a bit of a misuse. However, it will work... :-phalfer
I get : denied: requested access to the resource is deniedJuliatzin
What is the exact docker push command you are using? As per my advice above, you need to push a registry that exists, and that needs to be the built name of the image.halfer

1 Answers

3
votes

I could solve it using:

docker push registry.gitlab.com/group/project/api
docker push registry.gitlab.com/group/project/client

Here is what it looks like in the UI:

enter image description here

As specified in the relevant gitlab documentation chapter, you can use up to three levels for your images names:

  • registry.gitlab.com/group/project:tag
  • registry.gitlab.com/group/project/image1:tag
  • registry.gitlab.com/group/project/module1/image1:tag