我已经添加了project settings-> service connections-> add docker registry
,但是当我尝试将docker映像推送到自己的注册表中时,控制台向我显示x509: certificate signed by unknown authority
Docker Registry https://xxx.xxx.xx:5000/v2
Docker ID user
Password ********
当前我正在使用Azure Devops中的docker模板
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: Docker@2
inputs:
containerRegistry: 'XXXX'
repository: 'helloworld'
command: 'buildAndPush'
Dockerfile: 'Dockerfile'
但是我也尝试了脚本
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
steps:
- script: docker build -t xxx.xxx.xx:5000/helloworld:latest .
- script: docker login -u vauman -p JTeS2w276O79 xxx.xxx.xx:5000
- script: docker push xxx.xxx.xx:5000/helloworld:latest
两者都不起作用
这是在使用docker模板时的实际控制台结果,我很困惑为什么我的存储库名称的末尾有:3
Successfully built 6a29968xxxfb
Successfully tagged xxx.xxx.xx:5000/helloworld:3
[command]/usr/bin/docker push xxx.xxx.xx:5000/helloworld:3
The push refers to repository [xxx.xxx.xx:5000/helloworld]
Get ***: x509: certificate signed by unknown authority
##[error]Get ***: x509: certificate signed by unknown authority
##[error]/usr/bin/docker failed with return code: 1
答案 0 :(得分:0)
我发现还有另一个链证书,我必须将其与客户证书结合在一起。
cat client.crt >> chain.crt
效果很好!