Skip to content

Allow FreeBSD to be used with Docker executor (unofficially supported)

What does this MR do?

Allow FreeBSD to be used with Docker builds.

With recent releases of Podman, support for FreeBSD was added, allowing for containers to be run on FreeBSD using 'ocijail' which utilises FreeBSD Jails to provide container support. While still marked as experimental, initial testing on FreeBSD 14.0 with the version of Podman it ships with has shown that running builds is functional at least.

Why was this MR needed?

Currently Gitlab Runner contains code to check the operating system it is running on, and if it is not considered a supported operating system, denies the use of certain functionality such as Docker.

As Podman now includes support for FreeBSD (even if marked as experimental) the list of operating systems that Docker is allowed to be used with should be expanded to include FreeBSD as well.

What's the best way to test this MR?

  1. Spin up a virtual machine, and install FreeBSD 14.0 on it
  2. Install Podman (patched to fix https://github.com/containers/podman/issues/21117) and Gitlab Runner (with this patch)
  3. Configure FreeBSD following the instructions on the Podman site.
  4. Connect Gitlab Runner to Gitlab
  5. Run a job on the builder, using one of the FreeBSD images available at https://hub.docker.com/r/dougrabson/

Please note that while theoretically basic Linux containers should also be able to run on FreeBSD, I have not tested this.

A FreeBSD native Gitlab Runner helper image can be found at https://invent.kde.org/sysadmin/ci-images/container_registry under "freebsd14-gitlab-helper" (aka invent-registry.kde.org/sysadmin/ci-images/freebsd14-gitlab-helper). The Dockerfile that builds that image is currently in review at https://invent.kde.org/sysadmin/ci-images/-/merge_requests/226

What are the relevant issue numbers?

N/A

Merge request reports