0042. A GitLab CI component, included by URL from the release tag
Date: 2026-10-25
Context
Section titled “Context”Using the build farm from a job meant writing the buildctl call by hand,
and the two steps that break a push (registry credentials for the daemon,
and DOCKER_AUTH_CONFIG overriding them) were documented, not done for
the user. GitLab’s CI/CD components (include: component) work only within
one GitLab instance: a component on gitlab.com cannot be included by a
self-managed GitLab without mirroring the project, and pull mirroring is a
paid feature. include: remote works on every GitLab that can reach the
URL, validates inputs like a component, and checks an integrity hash
(GitLab 17.9). Both were checked on gitlab.com through its CI Lint API
(substituted inputs, an unknown input and a wrong hash refused, a file from
raw.githubusercontent.com at a tag fetched).
Decision
Section titled “Decision”- One self-contained file,
ci/gitlab/build.yml, versioned with the box (it depends on the runner contract:BUILDKIT_REMOTE_ADDR,BUILDKIT_TLS_DIR). Included fromraw.githubusercontent.com/<repo>/<tag>/ci/gitlab/build.ymlwith the hash the release notes print; tags are immutable. Copying it into a project works for GitLab without access to GitHub. - Inputs reach the script only as CI/CD variables, never as script text; list inputs are one item per line; the job name and stage are inputs (several images per pipeline); no global keywords. Users change the job by defining the same job name (GitLab merges the keys).
- The job logs in with the job token and unsets
DOCKER_AUTH_CONFIGby default, passes secrets by variable name (checked as a name before use), bounds buildctl with a timeout, counts Dockerfile steps from the plain progress, and writes the digest to a dotenv report. Its image is the daemons’ BuildKit release by digest (a test keeps them equal). - The CI/CD Catalog on gitlab.com (group
ci-acceleratorreserved) is a later, additional channel.
Consequences
Section titled “Consequences”- Any GitLab 17.9+ with access to GitHub uses it unchanged; older ones
drop
integrity(17.0+), offline ones copy the file. make component-testruns the script against a fake buildctl in its own image; real pipelines on gitlab.com with the box’s runner covered push with the job token, a secret, two images,push: false, a failing build withallow_failureset by job name, and the digest in a later job.