以下.drone.yml
:
kind: pipeline
steps:
- name: publish
image: registry.example.com/hub/plugins/docker
settings:
registry: registry.example.com
repo: registry.example.com/some/repo
tags: latest
username:
from_secret: registry-user
password:
from_secret: registry-pass
image_pull_secrets:
- docker-token
失败并出现以下错误:
发布:来自守护进程的错误响应:未授权:未授权访问存储库:hub/plugins/docker,操作:拉取:未授权访问存储库:集线器/插件/docker,操作:拉取
registry.thechubbypanda.net/hub
的代理在哪里hub.docker.com
。
秘密docker-token
是使用 cli 命令创建的:drone secret add --name docker-token --data ~/.docker/config.json --repository some/repo
.
该~/.docker/config.json
文件的内容是:
{
"auths": {
"https://registry.example.com": {
"auth": "MYLEGITTOKEN"
}
}
}