我正在使用gitlab.com并希望使用提供的共享运行程序构建我的项目 .
我有一个docker镜像,其中包含构建项目的所有依赖项 . 该图片位于 privateregistry.example.com
. 我的 .gitlab-ci.yml
文件如下所示:
image: privateregistry.example.com/myteam/myimage
before_script:
- npm install
build:
script:
# ...
由于它是一个私有注册表,我跟着instructions provided by gitlab并在 Settings -> Variables
下创建了一个变量 DOCKER_AUTH_CONFIG
,并使用我本地 ~/.docker/config.json
的内容作为值 .
但是,gitlab无法提取我的图像:
Running with gitlab-ci-multi-runner 1.8.0-rc.1 (1fd3fd4)
Using Docker executor with image privateregistry.example.com/myteam/myimage ...
Pulling docker image privateregistry.example.com/myteam/myimage ...
ERROR: Preparation failed: unauthorized: authentication required
Will be retried in 3s ...
我错过了什么?
1 回答
我没有做错任何事 . 今天,点击“重建”后,它就可以了 .
Edit: 有时候它有效,有时却没有 . 感谢gitlab.com的可靠性,我猜我需要设置自己的跑步者 .