Skip to content

compatibility with self hosted runners

Unfortunately, if I want to use this as a CI component in dedicated or self-hosted GitLab instances, the mirrored project’s build pipeline will fail due to the lack of prerequisite support for multi-architecture builds using Dockerx/Buildah. None of the "default" Linux images recommended in the GitLab documentation provide this support out of the box. The only reason your build pipelines work is because they rely on Google SaaS runners, which offer this capability.

This mismatch between SaaS runners and the default setup for other GitLab runners creates a dependency issue for this pipeline.

To address this, I propose improving the process by using custom DinD (Docker-in-Docker) images specifically configured to support multi-architecture builds. By explicitly defining the required images within the pipeline, you eliminate the dependency on runner capabilities.

Decoupling the build image dependencies in this way would make the project self-contained, with all its requirements for building fully specified within the pipeline, regardless of the underlying runner image.

Below an exmaple

container:
  stage: build
  # when building on Gitlab agent
  image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:${DOCKER_DIND_VERSION}
  parallel:
    matrix:
    - ARCH: 
      - arm64
      - amd64
      OS:
      - linux
      - darwin
  services:
    - name: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/docker:${DOCKER_DIND_VERSION}-dind
      alias: docker
  variables:
    CS_IMAGE: ${CS_IMAGE_COLLECTOR}
    DOCKER_TLS_CERTDIR: ""
    DOCKER_DRIVER: overlay2
    FF_NETWORK_PER_BUILD: "true"
    BUILDKIT_PROGRESS: plain
    DOCKER_BUILDKIT: 0
  before_script:  
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
    - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX
  script:
    - source scripts/build_container.sh