I am running a self-hosted GitLab (14.3.3-ee) instance with a shared runner on Centos7. I am also running a self-hosted Harbor Docker registry, and I would like it to be the default registry where the runner pulls all of its images from. For example, if I have a project with a .gitlab-ci.yaml file, starting with let’s say image: alpine:latest, I would like the runner to pull this image from my registry without me having to write image: myregistry.com:5000/alpine:latest. I already researched about this, but I never found exactly what I wanted.
The documentation that @jmanko (thanks for the tip) mentioned has the solution. Basically, this work needs to be done on the gitlab-runner, not the GitLab server.
update your daemon.json file for docker (mine was at /etc/docker/daemon.json)
Another thing to note - if the majority of your pipelines leverage the same image (lets call it your “base image”), you can set your base image in your config.toml gitelab-runner config. This will allow you to not specify an image for jobs that leverage this base image:
As an admin of the Runner, I would like that the users of the Runner do not have to specify the registry url. What I would need is some script that takes the image given by the user and automatically add the registry url before it before pulling the image.