我的笔记本电脑上的Gitlab CI运行程序无法执行ci,因为它无法访问CI_XXX env变量

时间:2019-02-21 23:17:56

标签: gitlab gitlab-ci gitlab-ci-runner

我已经按照其文档上的说明安装并注册了gitlab-runner。笔记本电脑正在运行linux mint。

我的config.toml看起来像这样。

Row.outColumnB = Row.ColumnB

如果我这样运行命令

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "tim-laptop-docker-runner"
  url = "https://gitlab.com"
  token = "REDACTED"
  executor = "docker"
  [runners.docker]
    tls_verify = false
    image = "docker:stable-dind"
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache" , "/home/tim/.ssh/id_rsa:/root/.ssh/id_rsa:ro"]
    shm_size = 0
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]

我收到此错误

gitlab-runner exec docker build_container 

我不应该得到这个,因为我在config.toml中拥有特权= true,所以我应该这样运行。

Runtime platform                                    arch=amd64 os=linux pid=9183 revision=8bb608ff version=11.7.0
WARNING: You most probably have uncommitted changes. 
WARNING: These changes will not be tested.         
Running with gitlab-runner 11.7.0 (8bb608ff)
Using Docker executor with image docker:stable ...
Starting service docker:stable-dind ...
Pulling docker image docker:stable-dind ...
Using docker image sha256:5b626cc3459ad077146e8aac1fbe25f7099d71c6765efd6552b9209ca7ea4dc1 for docker:stable-dind ...
Waiting for services to be up and running...

*** WARNING: Service runner--project-0-concurrent-0-docker-0 probably didn't start properly.

Health check error:
ContainerStart: Error response from daemon: Cannot link to a non running container: /runner--project-0-concurrent-0-docker-0 AS /runner--project-0-concurrent-0-docker-0-wait-for-service/service (executor_docker.go:1321:0s)

Service container logs:
2019-02-21T23:09:56.758732636Z mount: permission denied (are you root?)
2019-02-21T23:09:56.758783195Z Could not mount /sys/kernel/security.
2019-02-21T23:09:56.758789589Z AppArmor detection and --privileged mode might break.
2019-02-21T23:09:56.759360791Z mount: permission denied (are you root?)

现在我收到此错误

gitlab-runner exec docker build_container --docker-privileged

这里我可以连接到docker服务,但是当我尝试登录docker注册表时,它失败了,因为它无法访问CI_JOB_TOKEN变量。登录名上方的echo语句表明该变量丢失。

如何让gitlabRunner在自己的笔记本电脑上工作?为什么它不遵循我的配置文件中的privileged = true?

0 个答案:

没有答案