On self-managed GitLab the culprit is often a registry nobody switched on or a runner barred from privileged mode, so ask before writing a line.

In brief

  • The pipeline lives in .gitlab-ci.yml. The order of stages decides which jobs run first, and rules decide whether the pipeline and each job are created at all.
  • On self-managed GitLab the registry switches itself on only with the built-in Let's Encrypt integration. Otherwise the client's admin has to configure it.
  • Docker-in-Docker needs privileged mode, so ask the security team before writing an image build job.

A Forward Deployed Engineer arriving at a client rarely gets to choose the CI tool. A company that already hosts its own GitLab usually wants everything to run inside its infrastructure: code, pipelines, images.

The valuable skill, then, is reading the client’s GitLab quickly and writing a pipeline that works within the first week. Three pieces are involved: the pipeline file, the runner and the registry. Each has a habitual snag on self-managed installations.

A pipeline is one file, but order is what matters

The pipeline is declared in

.gitlab-ci.yml

. If you do not declare

stages

, GitLab uses the default set

.pre

,

build

,

test

,

deploy

,

.post

. The order of entries in

stages

decides which jobs run first.

There are two layers of conditions.

workflow:rules

decides whether the pipeline is created at all; when no rule matches, nothing runs. Job-level rules decide whether each individual job is created.

Say you are deploying a RAG API for the client’s data team. You want the pipeline to run only on the main branch, with tests first, then an image built and pushed to the registry, and deployment last:

workflow:
  rules:
    - if: $CI_COMMIT_BRANCH == "main"

stages: [test, build, deploy]

unit-test:
  stage: test
  image: python:3.12
  script:
    - pip install -r requirements.txt
    - pytest -q

build-image:
  stage: build
  image: docker:27.3
  services:
    - docker:27.3-dind
  variables:
    DOCKER_TLS_CERTDIR: "/certs"
  script:
    - echo "$CI_JOB_TOKEN" | docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" --password-stdin
    - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA"

deploy:
  stage: deploy
  image: alpine:3.20
  script:
    - ./deploy.sh "$CI_COMMIT_SHORT_SHA"

Run it in your head. A commit to the

feature/chunking

branch creates no pipeline, because the only rule does not match. If you are waiting for a pipeline that never appears, the first place to look is

workflow:rules

, not the runner.

The build job logs in with GitLab’s predefined variables instead of hard-coding an address such as

gitlab.client.local:5050

. Port 5050 is only the default when the registry switches itself on through the Let’s Encrypt integration. If the client’s admin configured the registry by hand, the host and port may well differ.

Image names still follow the registry/namespace/project pattern, so the name tells you which project an image belongs to. The docker image versions are pinned and TLS is enabled, as GitLab recommends when using Docker-in-Docker.

Which runner will run your jobs?

A YAML file runs nothing by itself. Jobs are executed by runners, agents running the GitLab Runner application. The software is open source, MIT-licensed and developed in the open in the gitlab-org/gitlab-runner project.

Runners come in three scopes: instance, group and project. A project runner suits a project that needs its own configuration, credentials and security controls. For an FDE handling a client’s sensitive data, that is usually the kind to request. Self-managed runners support three executors: Shell, Docker and Kubernetes.

The Docker executor runs each job in its own container, isolated from other jobs. Images are pulled according to the pull policy set in

config.toml

, which defaults to

always

.

Count them in the sample pipeline. Three jobs use three images, plus the build job’s

docker:27.3-dind

service, making four. With the

always

policy, every push to main means four pulls, and that number climbs quickly when the whole team is committing. GitLab’s dependency proxy can ease pressure from Docker Hub’s limits.

When job volume is high, the Kubernetes executor is worth considering, and two public cases show why. CERN moved its runners from Docker machine, a tool Docker has stopped developing, to Kubernetes, scaling from 0 to 100 pods on demand across more than 20 nodes.

SeatGeek replaced fixed-size runners on Nomad with the Kubernetes executor, one disposable pod per job. It migrated more than 600 repositories, doubled the number of concurrent jobs and cut average wait time from 16 seconds to 2.

Three traps on self-managed GitLab

The first trap is the registry. On an Omnibus installation, the registry switches itself on at port 5050 only when the built-in Let’s Encrypt integration is used. Otherwise the admin has to configure and enable it. Do not write a

docker push

job before you know whether the registry is running.

The second is privileged mode. The

build-image

job above uses Docker-in-Docker, which requires the runner to run in privileged mode. GitLab warns that this mode effectively disables the container’s security mechanisms and exposes the host to privilege escalation.

At a bank or a hospital, the answer may well be no. The image build job then has to be redesigned with the client’s infrastructure team, and you should know this before promising a delivery date.

The third is tier-dependent features. GitLab’s comparison table lists some features, such as the Dependency Proxy for Container Registry, Geo and disaster recovery, as available only on Self-Managed tiers. Ask which tier the client is on before relying on them.

GitLab’s Solutions Architects warn that optimizing runner resources for one team can shift repetitive chores onto developers. The question they suggest is worth carrying with you: does this solution create repetitive work for anyone?

For an FDE the question carries more weight still. Once you leave, the client is the one living with that pipeline.

What to learn first

Learn in the order you will meet things at a client. Start with the syntax of

stages

and

rules

, because, as the

feature/chunking

example shows, “the pipeline didn’t run” usually starts there. Then learn how to register a project runner with the Docker executor. Finally, learn to read

config.toml

and to name images according to the registry’s pattern.

When interviewing for an FDE role, ask directly how much the company’s clients tend to self-host their tools. The answer tells you whose infrastructure you will be working in, and shows the interviewer you understand the real job.

On a CV, one specific line outweighs a list of tools, for example: “wrote a three-stage GitLab pipeline on a dedicated project runner, agreed privileged mode with the client’s security team before building images”.

At a client, the first pipeline is also a test of whether you understand their infrastructure. Ask carefully about the registry, runners and privileged mode before writing the first line of YAML.

Was this article useful?

Thanks for the feedback!

Read next on the roadmap · Stage 5: DeploymentGetting onto a client's servers without opening port 22AWS Session Manager puts access in an IAM policy, but SSH tunnels through it leave no record of the session, and the client must know before signing off.