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.
GitLab
docs.gitlab.com › gitlab docs › administer › administer gitlab runner › register a runner
Registering runners | GitLab Docs
For runner registration with Docker, install GitLab Runner in a Docker container.
Top answer 1 of 3
3
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.
2 of 3
1
I use this command
sudo docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
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
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
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
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
11:01
Register GitLab Runner Instance to Run Pipelines - YouTube
11:01
Register Docker Runner/Executor with GitLab Server to Run Pipelines ...
How to Configure GitLab Runner with Docker Executor | Day 6 - YouTube
06:16
GitLab - How to easily register your runners? Support for ...
15:27
Auto Register Docker Runner/Executor with GitLab Server to Run ...
17:45
GitLab runner installation & registration - YouTube
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
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 › gitlab docs › install › install gitlab runner › 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.
Docker Hub
hub.docker.com › r › flakm › gitlab-runner-auto-register
flakm/gitlab-runner-auto-register - Docker Image
docker run --rm --entrypoint "/usr/bin/gitlab-runner" flakm/gitlab-runner-auto-register:latest register --help Copy
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.
GitLab
docs.gitlab.com › gitlab docs › administer › administer gitlab 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 › gitlab docs › administer › administer gitlab runner › 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 ...
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/gitlab-runner register --non-interactive --executor “docker” --docker-image alpine:latest --url “https://mygiturl.com/" --tls-ca-file “/etc/gitlab-runner/certs/ca.crt -n” --registration-token “XXXXXXX” --description “docker-runner-MYFIRST-RUNNER” --tag-list “docker” --run-untagged=”true” --locked=”false” --access-level=”not_protected” --docker-privileged
GitLab
gitlab.com › gitlab.org › gitlab-runner › repository
docs/register · c10ce6cbc1d24399be9cb2911d524708b2d69889 · GitLab.org / gitlab-runner · GitLab
If you're running the runner in a Docker container, run the register command with a structure similar to the following example: docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \ --non-interactive \ --executor "docker" \ --docker-image alpine:latest \ --url "https://gitlab.com/" \ --token "$RUNNER_TOKEN" \ --description "docker-runner"
TestDriven.io
testdriven.io › blog › gitlab-ci-docker
Deploying Self-Hosted GitLab CI Runners with Docker | TestDriven.io
October 29, 2021 - Run the following command to register a new runner, making sure to replace <YOUR-GITLAB-REGISTRATION-TOKEN> and <YOUR-GITLAB-URL> with your group's registration token and URL: $ docker-compose exec gitlab-runner-container \ gitlab-runner register \ --non-interactive \ --url <YOUR-GITLAB-URL> \ --registration-token <YOUR-GITLAB-REGISTRATION-TOKEN> \ --executor docker \ --description "Sample Runner 1" \ --docker-image "docker:stable" \ --docker-volumes /var/run/docker.sock:/var/run/docker.sock
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