我有 Azure DevOps 管道来构建容器。
trigger:
- main
resources:
- repo: self
variables:
dockerRegistryServiceConnection: '...'
imageRepository: '$(project)'
containerRegistry: $(ACRLoginServer)
dockerfilePath: '$(Build.SourcesDirectory)/DOCKERFILE'
tag: '$(Build.BuildId)'
azureContainerRegistry: azukschishinyacrd1.azurecr.io
azureSubscriptionEndpoint: azukschishinyacrd1
# Agent VM image name
vmImageName: 'ubuntu-latest'
stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
condition: not(eq('${{ variables.imageRepository }}', ''))
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
- task: Docker@2
inputs:
containerRegistry: $(dockerRegistryServiceConnection)
command: 'login'
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: $(imageRepository)
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
latest
- task: Docker@2
inputs:
containerRegistry: 'azukschishinyacrd1'
repository: $(imageRepository)
command: 'push'
DOCKERFILE 的开头有这一行
FROM myacrd1.azurecr.io/cellorbase:latest
当 DevOps 运行此行时,我收到错误
Error response from daemon: Head https://***/v2/cellorbase/manifests/latest: denied: retrieving permissions failed
Step 1/22 : FROM ***/cellorbase:latest
Head https://***/v2/cellorbase/manifests/latest: denied: retrieving permissions failed
##[error]Head https://***/v2/cellorbase/manifests/latest: denied: retrieving permissions failed
##[error]The process '/usr/bin/docker' failed with exit code 1
基本上,我无法从 Azure 容器注册表中提取镜像,但可以通过管道将镜像推送到其中。
在服务连接
下的设置
中,我已连接所有管道并授予其访问权限。
我在 Stackoverflow 上看到了其他帖子(例如 this one ),但它是关于推送图像而不是拉取图像。
您知道如何从 Azure 容器注册表中提取镜像以避免错误吗?
最佳答案
关于azure - 被拒绝 : retrieving permissions failed in Azure DevOps pipeline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68543195/