Local and GitLab jobs pulling from private repositories

I apologize if this is the wrong section!

I would like to run gitlab builds locally just like they would be on our gitlab server. The only issue I’ve run into are the permissions to pull from other private repositories in the same project in gitlab.

We have users A, B and C. They are working on the same repo. They have a .gitlab-ci.yml file and a Dockerfile. The repo is using Node.js which in itself needs the package.json (https://docs.npmjs.com/files/package.json#dependencies) file to handle dependencies for the repo.

In this file package.json we have the following line:

"my-module": "git+ssh://git@git.my.com:my-project/b.git#0.1.0

It pulls via git and ssh.

This works when we build locally, since in the Dockerfile we inject the users private key into the docker container. This means the docker container has access to the repository via git and can pull it.

This does not work when pushing to gitlab, since there is no private ssh key to inject (as far as I am concerned).

How do I set this up so that the following line can be run inside of a docker container in a job both locally and on our gitlab server:

"my-module": "git+ssh://git@git.my.com:my-project/b.git#0.1.0

All three may install the gitlab runner locally if needed and use that to start the .gitlab-ci.yml file. It’s just the permissions which is the issue. There should be some sort of configuration or sign in for the runners?