How to get Gitlab Runner working in a rootless Podman, for a headless service account.

Set SElinux to permissive

Unfortunately I’ve had to do this to allow the container to connect to the podman socket file. Of course it can be resolved with a custom policy but that’s outside the scope of this short post. I run my runners on their own VMs to mitigate this issue.

On any other RHEL-based OS you can resolve this with a very simple module, but not on CoreOS.

Edit /etc/selinux/config and change SELINUX=permissive, reboot.

Enable podman socket

Docker is controlled through a socket, so this emulates Docker by enabling a similar socket file.

systemctl --user start podman.socket
ls $XDG_RUNTIME_DIR/podman/podman.sock

Configure gitlab runner to use the podman socket

  name = "my-runner01"
  url = ""
  token = "token"
  executor = "docker"

    host = "unix:///run/user/1000/podman/podman.sock"

Run gitlab-runner container

This is a quadlet example of how to run the container.

Description=Gitlab runner podman.socket podman.socket




Headless quadlet

So far is enough if you’re logged in with the account, but if you’re deploying a runner using Ansible or Terraform you might do it on an account that you don’t login with. So you must enable linger to ensure the account can use systemd.

touch /var/lib/systemd/linger/gitlab

See also