gpt4 book ai didi

azure - 被拒绝 : retrieving permissions failed in Azure DevOps pipeline

转载 作者:行者123 更新时间:2023-12-03 03:47:38 25 4
gpt4 key购买 nike

我有 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

enter image description here

基本上,我无法从 Azure 容器注册表中提取镜像,但可以通过管道将镜像推送到其中。

服务连接下的设置中,我已连接所有管道并授予其访问权限。

enter image description here

我在 Stackoverflow 上看到了其他帖子(例如 this one ),但它是关于推送图像而不是拉取图像。

您知道如何从 Azure 容器注册表中提取镜像以避免错误吗?

最佳答案

我找到了问题和解决方案。基本上,我必须使用 Docker Compose,而不是使用 Azure 容器存储库登录

enter image description here

我对此写了一个分步解决方案link .

关于azure - 被拒绝 : retrieving permissions failed in Azure DevOps pipeline,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68543195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com