【发布时间】:2017-12-06 20:00:10
【问题描述】:
我在自己的 ubuntu 服务器上有一个简单的 gitlab-runner 设置。它是使用以下方式注册的:
sudo gitlab-runner register -n --url https://gitlab.com/ --registration-token {{GITLAB_REGISTRATION_TOKEN}} --executor shell --description "{{GITLAB_RUNNER_DESCRIPTION}}"
唯一正在运行的 gitlab-runner 进程 (ps -ef) 是:
/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-runner 用户的身份获取,在这种情况下它们会正确运行(作为 shell 执行程序)。
但有时,它以 root 身份运行,在这种情况下,它作为 docker 执行程序运行,然后报错(因为脚本在意外环境中运行)。
当服务上明显有 --user 时,为什么有时会以 root 身份运行?
【问题讨论】:
标签: gitlab-ci-runner