RousselTMLEARNING

Article · GitLab CI/CD: from discovery to expertise

Runners

1. Runner types and executors #

Choosing where jobs run.

Scope #

  • Instance runner: available to every project (GitLab.com shared runners).
  • Group runner: for a group's projects; project runner: dedicated to one project.
  • Tags route a job to a specific runner (tags: [gpu]); a runner may or may not accept untagged jobs.

Executors #

Executors

2. Installing and registering #

A runner in a container.

Installation #

docker volume create gitlab-runner-config
docker run -d --name gitlab-runner --restart always \
  -v gitlab-runner-config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock \
  gitlab/gitlab-runner:v19.6.1
docker exec -it gitlab-runner gitlab-runner register --non-interactive \
  --url https://gitlab.com --token "$RUNNER_TOKEN" \
  --executor docker --docker-image python:3.12-slim --description poste-local
  • Since GitLab 16, you create the runner in the UI (Settings › CI/CD › Runners › New project runner), which provides a glrt-… authentication token; the old registration token is removed.
  • Configuration lives in /etc/gitlab-runner/config.toml: concurrent (simultaneous jobs), volumes, default image, cache.
  • A distributed cache (S3, GCS) shares the cache between several runners or ephemeral machines.

3. Runner security #

A runner runs arbitrary code.

Rules #

RiskMitigation
Mounting /var/run/docker.sock gives control of the hostonly for trusted runners; prefer Buildah or Kaniko (rootless) to build images
Privileged mode (Docker-in-Docker)isolate on dedicated, ephemeral machines
Forks and external merge requestsno self-hosted runner on public projects without control; protected variables
Secrets left on the machineephemeral runners (autoscaler, Kubernetes), volume cleanup
Best practice : Separate runners by trust level: a runner that deploys to production must only serve protected branches ("protected" option).

Commands to know #

Commands to know
  • gitlab-runner register : register a runner
  • gitlab-runner list : configured runners
  • gitlab-runner verify : check the connection
  • docker logs -f gitlab-runner : runner log

Sources #

Checked in November 2026: CI/CD platforms change every month, check versions and plans in the vendor's documentation.

📄 GitLab runners: types, executors, installation and security →

My progress

  • ⏱ Estimated time : ≈ 4 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Questions about this lesson

No questions yet: be the first to ask for help or share your configuration.

Ask a question about this lesson →

Recommended Articles

Building and delivering with GitLab: registry, environments and deployments

Delivering with GitLab CI/CD: building and publishing images to the project registry, package reg...

GitHub Actions runners: hosted, self-hosted and ARC

Choosing where workflows run: hosted runners and images, larger runners, self-hosted runners (ins...

GitLab CI/CD: concepts and architecture

Discover GitLab CI/CD: the DevSecOps platform, the .gitlab-ci.yml file, pipelines, stages and job...

End-to-end CI/CD (1/5): principles and anatomy of a pipeline

Understand end-to-end CI/CD: continuous integration, continuous delivery and continuous deploymen...

End-to-end CI/CD (5/5): GitHub Actions, GitLab CI, Jenkins and Argo CD in practice

Compare and use CI/CD tools: GitHub Actions, GitLab CI, Jenkins, Argo CD and Flux; a complete pip...

GitHub Actions: concepts and how it works

Discover GitHub Actions: events, workflows, jobs, steps and actions, the Marketplace, hosted runn...

Writing a .gitlab-ci.yml: jobs, rules, cache and artifacts

Mastering .gitlab-ci.yml syntax: stages, jobs and images, rules and workflow, needs (DAG), cache ...

Reusing and securing GitLab pipelines

Industrializing GitLab CI/CD: extends, anchors and !reference, include, CI/CD components and cata...

GitLab CI/CD best practices and troubleshooting

Running GitLab CI/CD day to day: speeding up pipelines, controlling compute minutes, organizing f...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!