Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fluential/e97bbe0c0b04bc9a8335c8b6432fcca2 to your computer and use it in GitHub Desktop.
Save fluential/e97bbe0c0b04bc9a8335c8b6432fcca2 to your computer and use it in GitHub Desktop.
Run GitLab CI runner from non-root user account without it complaining for the "user mode" thing
cat > /etc/systemd/system/gitlab-runner.service.d/override.conf <<EOF
[Service]
User=gitlab-runner
Group=gitlab-runner
ExecStartPre=+ln -sf /var/run/podman/podman.sock /var/run/docker.sock
ExecStart=
ExecStart=strace -e getuid,getgid -e inject=getuid:retval=0 -e inject=getgid:retval=0 -- /usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --user gitlab-runner
EOF
https://gitlab.com/gitlab-org/gitlab-runner/-/blob/3d085c49b3ef9886697e6b25c7856da2e1018d2d/commands/user_mode_warning.go#L21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment