【问题标题】:What is the special gitlab-ci-token user?什么是特殊的 gitlab-ci-token 用户?
【发布时间】:2016-09-24 21:13:56
【问题描述】:

gitlab 容器注册表 (https://gitlab.com/help/container_registry/README.md) 的文档提供了一个配置示例,其中包含以下说明:

- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.example.com

还有这个解释:

You have to use the credentials of the special gitlab-ci-token user with its password stored in $CI_BUILD_TOKEN in order to push to the Registry connected to your project. This allows you to automated building and deployment of your Docker images.

我找不到任何关于这个特殊gitlab-ci-token 用户的文档,也找不到关于$CI_BUILD_TOKEN var 的任何文档。

这个特殊用户是什么?它是自动可用的吗?它必须在某个地方定义吗?应该为$CI_BUILD_TOKEN var 赋予什么值?

【问题讨论】:

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


    【解决方案1】:

    Gitlab 充当注册表的身份验证提供程序。 gitlab-ci-token 是自动为您创建的用户。 CI_BUILD_TOKEN 由 Gitlab-CI 为每个构建自动设置

    【讨论】:

    • 你真的设法让它工作了吗?你在哪里找到这些信息的?它记录在哪里?我刚刚更新了我的 gitlab CE 安装,但它仍然无法正常工作。 echo $CI_BUILD_TOKEN 什么都不返回 $ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.xxxxx.com Error response from daemon: Get https://registry-1.docker.io/v... unauthorized: incorrect username or password
    • 是的,我有它的工作:$ docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.mydomain.com Login Succeeded 信息可以在这里找到:docs.gitlab.com/ce/container_registry/README.htmlSection Build and push images using GitLab CI 该变量仅在构建过程中可用,而不是在运行 GitLab 的机器上。如果您想从那里登录,请使用登录 GitLab 时使用的相同凭据
    • 从 gitlab 购买的一些有用信息:需要 gitlab runner 1.2。现在可以了。
    • 部署时如何从目标服务器登录docker注册表?
    • 您的部署运行程序(可能是该服务器上的专用运行程序或通过 ssh 连接)被注入凭据,以便它可以登录。如果仍不清楚,请提供有关您的设置的更多信息。
    【解决方案2】:

    就我而言,upgrading of gitlab-runner 帮助了我

    【讨论】:

      【解决方案3】:

      就我而言,这行得通CI-permission

      因此,使用用户 cred 作为 gitlab-ci-token 和由他们创建的 $CI_BUILD_TOKEN。

      • 任何对可以运行 CI 作业的项目具有开发人员访问权限的人都可以读取该令牌,从而允许开发人员为该项目注册任何特定的 Runner。
      • 令牌将只允许访问项目的源,禁止访问任何其他项目。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-06-24
        • 1970-01-01
        • 2017-11-28
        • 2018-02-27
        • 2016-09-08
        • 2020-02-02
        • 2021-07-31
        相关资源
        最近更新 更多