【发布时间】:2020-09-10 15:23:02
【问题描述】:
当使用 Docker Compose Preview 定义时,Azure 应用服务是否仅支持存储在 Docker 中的图像。
我的图像存储在 Azure 容器注册表 (ACR) 中。然而,当我使用 Docker 撰写预览引用存储在 ACR 中的图像时,它会尝试从 Docker Hub 中提取图像,而不是 registry-1.docker.io,它们没有被存储并且失败。
DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://registry-1.docker.io/v2/dev/my_container/manifests/latest: unauthorized: incorrect username or password"}
version: '3.3'
services:
container_one:
image: "dev/container_one"
ports:
- "80:80"
restart: always
container_two:
image: "dev/container_two"
ports:
- "81:81"
restart: always
【问题讨论】:
-
您必须包含指向您的 ACR 的链接
-
在图片标签中对吗?像
image: "my.azurecr.io/dev/container_one"对吗? -
是的,您需要在实际映像之前包含 ACR 存储库名称,否则它将默认从 Docker Hub 中提取 - 当您将 container_one 和 container_two 映像引用更新为
image: "my.azurecr.io/dev/container_one"时,它是否不起作用? -
转到您的 ACR 并单击您的图像标签,它将显示工件参考,您需要将其设置为图像的值。
-
谢谢大家,包括 ACR 的完整链接解决了这个问题。
标签: azure docker docker-compose yaml docker-image