Both containers (the temporary one and the actual gitlab-runner instance) share a volume together -v /srv/gitlab-runner/config:/etc/gitlab-runner in which the registration token is stored. The actual instance of the runner can then use that token from the generated config to authenticate with the gitlab instance.

Answer from pat on Stack Overflow
🌐
GitLab
docs.gitlab.com › runner › register
Registering runners | GitLab Docs
sudo -u gitlab-runner -H /usr/local/bin/gitlab-runner register --non-interactive \ --url "https://gitlab.com/" \ --token "$RUNNER_TOKEN" \ --executor "docker" \ --docker-image alpine:latest \ --description "docker-runner"
🌐
GitLab
docs.gitlab.com › runner › install › docker
Run GitLab Runner in a container | GitLab Docs
For system volume mounts, add -v /srv/gitlab-runner/docker-machine-config:/root/.docker/machine · For Docker named volumes, add -v docker-machine-config:/root/.docker/machine · Register a new runner.
Discussions

GitLab Runner in Docker
I’d suggest setting up your runners using the docker executor - https://docs.gitlab.com/runner/executors/docker.html This allows your runner to start up fresh containers for jobs with the image you specify, meaning jobs aren’t running on the host and can have whatever you need. You can then also use a single runner with parallelism instead of multiple runners. Downside is that if you need to install extras they will need to install as part of the CI on every job. More on reddit.com
🌐 r/gitlab
6
3
August 31, 2023
Permission issue with gitlab-runner
It turned out I needed to add the gitlab-runner user to the docker group and stop running commands with sudo as you said . More on reddit.com
🌐 r/gitlab
6
2
July 17, 2023
Confused with gitlab-runner and executor
First q - nope! When people refer to the executor, they (should) only mean "the mechanism of which will be the acting environment for your pipeline commands to run in". If you use a shell-executor, it could be performed by the docker install or the binary install of the runner, and same for the docker-executor 2. Performance can be a bit of an issue - the trade off with dockerized builds are that 1 computer/VM can run multiple, simultaneous, totally isolated pipelines, whereas a shell runner can only safely run 1. While performance might drop off, there's the gain of not having to have several machines/vm's created (much more overhead from a full-os vs just a container). For context, I see network latency increase when I use a docker-windows executor running 5 different queued pipeline tasks on this 1 machine (16gb Ram, 8 CPU) and some CPU drop off, but if I were to spin up 5 different machines to handle this same work load (5 pipeline tasks queued at the same time, I'm probably not fully utilizing the resources but I definitely am hogging more resources that could be leveraged. Now taking into consideration that you have both a shell & a docker executor, it would depend on what kind of code you're pipeline is working with and how a build consumes resources - if you are building a java project, it would be hard to see a performance impact unless it's true massive, but for something like NodeJS with tons of packages, it would definitely cause impact if the shell runner executed a job while the docker executor took a few jobs as well, if say, using that same 16gb RAM & 8 Core machine. For some organization, I've kept shell runners on their own machine, because if someone edits their gitlab ci file to do something that affects the shell runner permanently (like "sudo apt upgrade", or something that causes a variable to linger beyond the build that affects the next build) then I have to worry about fixing that issue. There are good use cases for the shell runners though, but the docker executors provide the quickest way to scale pipelines to 100+ repositories, averaging 10 builds an hour during work hours (20 min pipeline execution). In some sort of motivational stance, if you have the extra machine power waiting around, I think you should be adding more features into your pipeline, which would then show you the need for the simultaneous task execution. Gitlab 's SAST jobs, coverage testing, linting, or even live execution of code for smoke tests or things of that nature could be explored to add value to the pipelines. All those combined would create a lengthy pipeline execution time, so there's more reason to attempt to run as many as these in parallel as possible. More on reddit.com
🌐 r/gitlab
1
3
May 5, 2023
x509 Error when registering runner: Is there a way to do an sslNoverify with Gitlab Runners like you can with Git?
Pretty sure the answer is no, no way to explicitly tell it to ignore SSL errors. https://docs.gitlab.com/runner/configuration/advanced-configuration.html From a security perspective its probably worth the effort to get your certs working though. https://docs.gitlab.com/runner/configuration/tls-self-signed.html Its mostly just putting your root cert / self signed cert in the `/etc/gitlab-runner/certs` directory. More on reddit.com
🌐 r/gitlab
3
1
January 3, 2022
🌐
Medium
medium.com › @BuildWithLal › dockerized-gitlab-ci-setting-up-and-connecting-your-gitlab-runner-b810a02e42f2
Dockerized GitLab CI: Setting Up and Connecting Your GitLab Runner | by Lal Zada | Medium
October 10, 2024 - After updating the docker-compose.yml file, hit CTRL+C to stop the running container and then run ... Keep watching for the health status of both Gitlab Server and Runner containers. ... Once both are healthy, you can go back to the Runner page for your project here http://localhost:8000/root/build-with-lal/-/settings/ci_cd under ... Click on the New project runner and follow the same steps as we followed earlier to generate command for registering GitLab runner which will look like this
🌐
Awsworkshop
gitlab.awsworkshop.io › 050_lab_2 › 52_runner.html
Install and register Runner :: MP DevOps Series
You will be prompt to enter registration token, copy it from the Runner settings. Paste it in the console. Enter Description for the runner: type GitLab workshop. ... Enter executor, type docker.
🌐
YouTube
youtube.com › watch
How to register & run GitLab Runner inside a Docker container
Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube.
🌐
Datawookie
datawookie.dev › blog › 2022 › 03 › pre-registered-gitlab-runner-in-a-container
Pre-Registered GitLab Runner in a Container
January 20, 2026 - FROM gitlab/gitlab-runner:v14.7.0 RUN apt-get update && \ apt-get install -y docker.io COPY gitlab-runner-register.sh .
Find elsewhere
🌐
Medium
medium.com › @BuildWithLal › dockerized-gitlab-ci-register-docker-executor-as-a-gitlab-runner-71799352c9ac
Dockerized GitLab CI: Register Docker Executor as a GitLab Runner | by Lal Zada | Medium
October 10, 2024 - Once you have updated docker-compose.yml, hit CTRL+C to stop running containers and then run ... Existing runner is the Shell executor we created in our last post. ... Fill out the runner details. Make sure to add tags so we can run different jobs by specifying a specific runner using these tags. ... Once logged in to the GitLab runner container, run command from the above Step 1. Make sure to add these flags to the end of the gitlab-runner register …
🌐
GitLab
docs.gitlab.com › runner
GitLab Runner | GitLab Docs
Enables caching of Docker containers. Seamless installation as a service for GNU/Linux, macOS, and Windows. Embedded Prometheus metrics HTTP server. Referee workers to monitor and pass Prometheus metrics and other job-specific data to GitLab. This diagram shows how runners are registered and how ...
🌐
GitLab
docs.gitlab.com › runner › executors › docker
Docker executor | GitLab Docs
The Docker executor uses Docker Engine to run each job in a separate and isolated container. To connect to Docker Engine, the executor uses: The image and services you define in .gitlab-ci.yml. The configurations you define in config.toml. You can’t register a runner and its Docker executor ...
🌐
GitLab
docs.gitlab.com › ci › docker › using_docker_images
Run your CI/CD jobs in Docker containers | GitLab Docs
To run CI/CD jobs in a Docker container, you need to: Register a runner and configure it to use the Docker executor.
🌐
Docker Hub
hub.docker.com › r › flakm › gitlab-runner-auto-register
flakm/gitlab-runner-auto-register - Docker Image
To create runner that registres itself in more then one project set LOCKED_MODE to false and provide both ADMIN_TOKEN and PROJECTS_TO_REGISTER variables. REGISTRATION_TOKEN="" ADMIN_TOKEN="" PROJECTS_TO_REGISTER="5309683;4904307" docker run -d -e "CI_SERVER_URL=https://gitlab.com/" \ -e ...
🌐
GitLab
docs.gitlab.com › ee › ci › docker › using_docker_build.html
Use Docker to build Docker images | GitLab Docs
May 8, 2023 - Use docker and privileged mode: sudo gitlab-runner register -n \ --url "https://gitlab.com/" \ --registration-token REGISTRATION_TOKEN \ --executor docker \ --description "My Docker Runner" \ --tag-list "tls-docker-runner" \ --docker-image "docker:24.0.5-cli" \ --docker-privileged \ ...
🌐
GitLab
docs.gitlab.com › runner › executors › docker_machine
Install and register GitLab Runner for autoscaling with Docker Machine | GitLab Docs
Install GitLab Runner. Install Docker Machine from the Docker Machine fork. Optionally but recommended, prepare a proxy container registry and a cache server to be used with the autoscaled runners.
🌐
Medium
vineetcic.medium.com › registering-gitlab-runners-2f78703d024e
Registering GITLAB-Runners. Registering a Runner is the process… | by Vineet Kumar | Medium
July 30, 2021 - Make sure to restart the whole container instead of using gitlab-runner restart: docker restart gitlab-runner · One line Registration command with docker excecutor: docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/git...
🌐
GitLab
gitlab.com › gitlab.org › gitlab-runner › repository
docs/register · 19a93fdee8c7dc6b24baa87d19ac7009aa5c0940 · GitLab.org / gitlab-runner · GitLab
GitLab Runner is the open source project that is used to run your CI/CD jobs and send the results back to GitLab
🌐
GitHub
gist.github.com › kaangiray26 › 5832f0e55ee94d279244027481c8423f
Installing and Registering Gitlab Runner on Docker · GitHub
docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
🌐
GitLab
gitlab.com › gitlab.org › gitlab-runner › container registry
Container registry · GitLab.org / gitlab-runner · GitLab
GitLab Runner is the open source project that is used to run your CI/CD jobs and send the results back to GitLab
🌐
Medium
medium.com › @fixitblog › solved-how-does-gitlab-register-a-runner-on-a-docker-container-dec955ebe5b9
How does Gitlab register a runner on a Docker container? | by Ted James | Medium
June 23, 2024 - I register the runner (which completes without issue): docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
🌐
OneUptime
oneuptime.com › home › blog › how to set up docker with gitlab ci runner
How to Set Up Docker with GitLab CI Runner
January 16, 2026 - version: '3.8' services: gitlab-runner: image: gitlab/gitlab-runner:latest restart: always volumes: - ./config:/etc/gitlab-runner - /var/run/docker.sock:/var/run/docker.sock environment: - TZ=UTC · # Register runner interactively gitlab-runner register # You'll be prompted for: # - GitLab instance URL # - Registration token # - Runner description # - Tags # - Executor type (choose docker) # - Default Docker image