什么是特殊的gitlab-ci-token用户?

use*_*137 20 gitlab docker gitlab-ci gitlab-ci-runner

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_TOKENvar的文档.

这个特殊用户是什么?它是自动可用的吗?是否必须在某处定义?应该给$CI_BUILD_TOKENvar 什么值?

Mar*_*tin 13

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来自守护进程的错误响应:获取https://registry-1.docker.io/v ..未经授权:用户名或密码不正确``` (3认同)
  • gitlab购买中的一些有用信息:需要gitlabRunner 1.2。现在可以了。 (2认同)
  • 以及它在部署期间如何从目标服务器登录到 docker 注册表? (2认同)