将图像推送到Azure DevOps管道中的Azure容器注册表任务失败。当试图从本地系统中提取或推送时,没有问题,但是当尝试使用Azure Devops管道时,它就失败了。Docker登录成功,但当我想从ACR中提取图像时,它失败了,结果如下:
**Error response from daemon: Head "***/a2/abcd/manifest/latest": unauthorized: Invalid clientid or client secret.
##[error]Bash exited with code '1'.
##[debug]Processed: ##vso[task.issue type=error;]Bash exited with code '1'.
我检查了and中的所有服务连接,它们看起来都配置正确。检查关联的服务主体,如果它们具有AcrPull
和AcrPush
权限,则它们都已就位。只是不明白出了什么问题。
我的Yaml看起来是这样的:
trigger: none
schedules:
- cron: "0 0 0 * *"
displayName: **** *
branches:
include:
- abcd
always: true
pool:
vmImage: 'ubuntu-latest'
variables:
- name: acrname
value: *****.azurecr.io
stages:
- stage: abcd
displayName: "pull images from acr"
jobs:
- job: abcdef
displayName: "abcdef"
pool:
vmImage: ubuntu-latest
steps:
- task: Docker@2
displayName: Login to ACR
inputs:
command: login
containerRegistry: '*****.azurecr.io'
- bash: |
docker pull $(acrname)/abc-def:latest
docker pull $(acrname)/igh-jkl:latest
name: pull
displayName: 'pull acr images'
有人能帮忙吗?
发布于 2022-08-18 08:45:20
获得。
发布于 2022-02-25 20:10:35
在我的例子中,当我遇到这个问题时,简单而清晰的解决方案是使用docker登录名。在您的情况下,这似乎是一个很好的解决方案:
docker login $(acrname)
在你打电话来获取你的图像之前
docker pull $(acrname)/abc-def:latest
发布于 2022-07-29 10:14:37
在我的例子中,码头登录密码过期了。所以我必须做以下几件事:
authentication.
码头管理员登录blah.azurecr.io --用户名-用户名-这里-密码blah.azurecr.io
https://stackoverflow.com/questions/70308425
复制相似问题