Skip to content

Build container images

Buildah

Issues:

Fails to build with vfs driver on kubernets executor, see this failed job example

Multi arch builds

Podman / Buildah

In order to run Buildah in a custom gitlab-runner on Kubernetes, the scheduled runner pods need to run in privileged mode, unfortunately.

First install prerequisites (also on K8s nodes which gitlab-runner schedule pods on):

Debian:

apt install -y podman buildah qemu-user-static

Arch:

sudo pacman -S qemu-user-static qemu-user-static-binfmt

RedHat flavors:

sudo yum install -y podman buildah qemu-user-static

Then you can use the --platform parameter in Gitlab CI:

buildah build --platform linux/arm64/v8,linux/amd64 -t multiarch:latest