我使用的是gitlab.com,並且希望使用提供的共享運行程序來構建我的項目。使用GitLab CI的私人碼頭註冊表
我有一個碼頭圖像,其中包含所有依賴建立項目。該圖像位於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 ...
我缺少什麼?
如果您的祕密包含不可打印的字符,您還可以通過轉義特殊字符來解決問題。可能會讓你困擾的特殊字符包括$和%以及^和〜等等。 –