On self-hosted GitLab, the problem is often a container registry nobody enabled or a Runner with privileged mode disabled. Ask before you start writing.

Key takeaways

  • Pipelines are defined in .gitlab-ci.yml. The order of stages determines which jobs run first, and rules determine whether the pipeline and each job get created at all.
  • On self-hosted GitLab, the container registry is only enabled automatically when you use the built-in Let's Encrypt integration; otherwise the customer's administrator needs to configure it.
  • Docker-in-Docker requires privileged mode, so consult the security team before writing any image build job.

As a Forward Deployed Engineer (FDE), you rarely get to pick the CI tool at a customer. Companies that already run their own GitLab usually want code, pipelines, and images to stay entirely on their own infrastructure.

So the skill that really matters is quickly understanding the customer's GitLab and writing a working pipeline within the first week. That involves three things: the pipeline file, the Runner, and the container registry. In self-hosted environments, each one has a common pitfall.

The pipeline is just a file; the order is what matters

The pipeline is declared in

.gitlab-ci.yml

. If you don't declare

stages

, GitLab uses a default set of stages:

.pre

、

build

、

test

、

deploy

、

.post

。

stages

The order of entries in

Conditions work on two levels.

workflow:rules

determines whether the pipeline is created; if no rule matches, nothing runs. Job-level rules determine whether each individual job is created.

Suppose you're deploying a retrieval-augmented generation (RAG) API for the customer's data team. You want the pipeline to run only on the main branch: run tests first, then build the image and push it to the registry, and finally deploy:

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 push to the

feature/chunking

branch won't create a pipeline, because the only rule doesn't match. If you've been waiting for a pipeline that never appears, the first thing to check is

workflow:rules

, not the Runner.

The build job logs in using GitLab's predefined variables instead of hardcoding an address like

gitlab.client.local:5050

. Port 5050 is only the default when the registry was enabled automatically via the Let's Encrypt integration. If the customer's administrator configured the registry manually, the host and port will likely differ.

The image name still follows the "registry/namespace/project" format, so you can tell from the name which project an image belongs to. The docker image version is pinned, and TLS is enabled following GitLab's recommendation for Docker-in-Docker.

Which Runner executes your jobs?

The YAML file itself runs nothing. Jobs are executed by Runners, agents that run the GitLab Runner application. The software is open source under the MIT license and developed publicly in the gitlab-org/gitlab-runner project.

Runners come in three scopes: instance, group, and project. Project Runners suit projects that need isolated configuration, credentials, and security controls. When an FDE handles a customer's sensitive data, this is usually the one to request. Self-hosted 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

, whose default is

always

。

Count with the example pipeline. Three jobs use three images, plus the build job's

docker:27.3-dind

service, four in total. Under the

always

policy, every push to main pulls four times; when the whole team is committing, that number climbs fast. GitLab's Dependency Proxy can ease the pressure from Docker Hub rate limits.

When job volume is high, the Kubernetes executor is worth considering, and two public cases show why. CERN migrated its Runners from Docker machine (a tool Docker has deprecated) to Kubernetes, scaling on demand from 0 to 100 Pods across more than 20 nodes.

SeatGeek replaced fixed-scale Runners on Nomad with the Kubernetes executor, one disposable Pod per job. It migrated over 600 repositories, doubled concurrent jobs, and cut average wait time from 16 seconds to 2 seconds.

Three pitfalls of self-hosted GitLab

The first pitfall is the container registry. In Omnibus installations, the registry is only enabled automatically on port 5050 when you use the built-in Let's Encrypt integration; otherwise an administrator must configure and enable it. Don't write

docker push

jobs until you've confirmed 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, exposing the host to privilege escalation risks.

At a bank or hospital, the answer is likely no. In that case, the image build job has to be redesigned together with the customer's infrastructure team. Sort this out before committing to a delivery date.

The third is version-dependent features. GitLab's comparison table lists some features as available only in certain Self-Managed tiers, such as Dependency Proxy for Container Registry, Geo, and disaster recovery. Before relying on any of them, ask which version the customer is running.

GitLab Solutions Architects point out that optimizing Runner resources for one team can shift repetitive grunt work onto developers. The question they recommend is worth keeping at hand at all times: will this solution create duplicate work for anyone?

For an FDE, this question carries even more weight. After you leave, it's the customer who lives with this pipeline day in and day out.

What to learn first

Learn things in the order you'll encounter them at the customer. Start with the syntax of

stages

and

rules

, because as the

feature/chunking

example shows, "the pipeline didn't run" usually comes down to this. Then learn how to register a project Runner with the Docker executor. Finally, learn to read

config.toml

and name images according to the registry format.

In an FDE interview, ask directly: how often do the company's customers self-host their tools? The answer tells you whose infrastructure you'll be working in, and shows the interviewer that you understand what the job actually involves.

On your resume, one concrete line beats a list of tools, for example: "Wrote a three-stage GitLab pipeline on a dedicated project Runner, agreeing with the customer's security team on privileged mode use before building images."

At the customer, the first pipeline is also a test of whether you understand their infrastructure. Before writing your first line of YAML, ask about the registry, the Runner, and privileged mode.

Was this article helpful?

Thanks for your feedback!

Next on the roadmap · Phase 5: Deployment launch — Log in to customer servers without opening port 22. AWS Session Manager manages access with IAM policies, but SSH tunnels through it leave no session logs, so you must inform the customer first.