gitlab-runner 随机运行 root 而不是用户 gitlab-runner

gitlab-runner randomly runs as root rather than user gitlab-runner

我在自己的 ubuntu 服务器上有一个简单的 gitlab-运行ner 设置。它是使用以下方式注册的:

sudo gitlab-runner register -n --url https://gitlab.com/ --registration-token {{GITLAB_REGISTRATION_TOKEN}} --executor shell --description "{{GITLAB_RUNNER_DESCRIPTION}}"

唯一的 gitlab-运行ner 进程 (ps -ef) 即 运行ning 是:

/usr/bin/gitlab-runner run --working-directory /home/gitlab-runner --config /etc/gitlab-runner/config.toml --service gitlab-runner --syslog --user gitlab-runner

我的 /etc/gitlab-runner/config.toml 配置文件包含:

concurrent = 1
check_interval = 0

[[runners]]
  name = "iouze/landing"
  url = "https://gitlab.com/"
  token = "0530b.....6f9"
  executor = "shell"
  [runners.cache]

当我的 CI 管道触发时,作业有时会以用户 gitlab-运行ner 用户的身份被拾取,在这种情况下,他们 运行 正确地(作为 sheell 执行者)。

但有时,它 运行s 作为 root,在这种情况下它 运行s 作为 docker 执行者,然后给出错误(因为脚本是 运行在意想不到的环境中)。

当服务上明显有 --user 时,为什么有时 运行 会以 root 身份使用?

我 运行 在 gitlab.com 并且管道作业有时会被已经在那里配置的共享运行器接收。我禁用了共享跑步者