Using Private GitLab Container Registry in GitLab CI

I have private project group on GitLab.
I store all the images on its container registry.
Can another project in the same group, using that registry as the base image on GitLab CI job?

Hi @altianogerung, good question!

Can another project in the same group, using that registry as the base image on GitLab CI job?

Yes, you can absolutely use your Private GitLab Container Registry as the source for base image in CI job.

To do so, you’ll need to define the image: in your CI job to use your local registry (eg. image: registry.gitlab.com/greg/docker/docker:stable instead of image: docker:stable)

As its a private registry, you’ll also need pass the credentials to authenticate before you can docker pull the image. There are several ways to do this outlined here:

go to private project settings > CI/CD > Token Access,
you can

  1. turn off “Limit access to this project”, and allow all other projects to access this project.
  2. add custom project to allowlist.
1 Like

Exactly, that setting made it work, thanks!