gpt4 book ai didi

Azure ACR 任务无法从 Azure 容器注册表中提取 docker 镜像

转载 作者:行者123 更新时间:2023-12-03 05:36:34 26 4
gpt4 key购买 nike

我正在关注this文章。我有一个 Azure 容器注册表,如下图所示,并且我已定义如下任务。

az acr task create \
--name krushnaTask \
--registry krushna \
--cmd python-hello \
--schedule "1 10 * * *" \
--context /dev/null

当 Azure 运行任务时,它给出以下错误:

2020/06/02 11:02:03 Alias support enabled for version >= 1.1.0, please see https://aka.ms/acr/tasks/task-aliases for more information.
2020/06/02 11:02:03 Creating Docker network: acb_default_network, driver: 'bridge'
2020/06/02 11:02:03 Successfully set up Docker network: acb_default_network
2020/06/02 11:02:03 Setting up Docker configuration...
2020/06/02 11:02:04 Successfully set up Docker configuration
2020/06/02 11:02:04 Logging in to registry: krushna.azurecr.io
2020/06/02 11:02:05 Successfully logged into krushna.azurecr.io
2020/06/02 11:02:05 Executing step ID: acb_step_0. Timeout(sec): 3600, Working directory: '', Network: 'acb_default_network'
2020/06/02 11:02:05 Launching container with name: acb_step_0
Unable to find image 'python-hello:latest' locally
docker: Error response from daemon: pull access denied for python-hello, repository does not exist or may require 'docker login': denied: requested access to the resource is denied.
See 'docker run --help'.
2020/06/02 11:02:05 Container failed during run: acb_step_0. No retries remaining.
failed to run step ID: acb_step_0: exit status 125

如何才能让 ACR 任务访问 docker 镜像?

Azure ACR repo image Azure ACR task details

最佳答案

我很确定问题是您需要将图像输入为 krushna.azurecr.io/python-hello:tag 因为该图像位于您的 ACR 中。当你输入的镜像为 python-hello 时,意味着它是 Docker hub 中的公共(public) docker 镜像,因此会因为在 Docker hub 中找不到该镜像而导致错误。像下面这样更改命令,它会正常工作:

az acr task create \
--name krushnaTask \
--registry krushna \
--cmd krushna.azurecr.io/python-hello \
--schedule "1 10 * * *" \
--context /dev/null

关于Azure ACR 任务无法从 Azure 容器注册表中提取 docker 镜像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62151874/

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