azure - Azure ACR 任务无法从 Azure 容器注册表中提取 docker 映像
问题描述
我正在关注这篇文章。我有一个 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 镜像?
解决方案
我很确定问题是您需要输入图像,krushna.azurecr.io/python-hello:tag
因为图像在您的 ACR 中。当您输入图像时python-hello
,表示它是 Docker hub 中的公共 docker 图像,因此导致错误,因为它无法在 Docker hub 中找到该图像。更改如下命令,它将运行良好:
az acr task create \
--name krushnaTask \
--registry krushna \
--cmd krushna.azurecr.io/python-hello \
--schedule "1 10 * * *" \
--context /dev/null
推荐阅读
- delphi - Cross-form variable with Multiple forms
- anaconda - 将 Anaconda 环境克隆到不同的机器
- azure - 为 Windows VM 调用 AzureRMVMRunCommand
- java - 如果对具体类进行更改,是否依赖接口而不是具体类会减少 Java 中的编译时间?
- python - Can't import module from subdirectory
- sql - SQL - 特定名称字段的响应时间计数范围
- java - What does the statement Object[][] data = new Object [][] mean?
- sql - Physical Pkey in Fact table
- github - 当我使用 git add 'sampleFile.txt' 时,Git 给了我'Permission Denied'
- java - 获取2个字符串的重复值并计算它们