【发布时间】:2020-12-28 09:17:04
【问题描述】:
我正在准备 Azure AZ500 认证。 我被困在实验室,其中包括使用 aTAG 创建基于 loginServer 的本地 Docker 映像。
目的是能够将之前在本地创建的 VM 映像推送到私有 Azure 存储库。
PS C:\> az acr list
[
{
"adminUserEnabled": false,
"creationDate": "2020-12-26T23:55:33.321068+00:00",
"dataEndpointEnabled": false,
"dataEndpointHostNames": [],
"encryption": {
"keyVaultProperties": null,
"status": "disabled"
},
"id": "/subscriptions/5a89d093-ada0-4d4e-9a12-fe7b87e94eff/resourceGroups/AZContainersRG/providers/Microsoft.ContainerRegistry/registries/AZDemoACRE",
"identity": null,
"location": "westeurope",
"loginServer": "azdemoacre.azurecr.io",
"name": "AZDemoACRE",
"networkRuleSet": null,
"policies": {
"quarantinePolicy": {
"status": "disabled"
PS C:\> docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/azuredocs/azure-vote-front v1 0e7801ad0561 12 hours ago 944MB
tiangolo/uwsgi-nginx-flask python3.6 997d8bb5f569 8 days ago 944MB
mcr.microsoft.com/oss/bitnami/redis 6.0.8 3a54a920bb6c 2 months ago 103MB*
PS C:\> docker tag azure-vote-front azdemoacre.azurecr.io/azure-vote-front:v1
Error response from daemon: No such image: azure-vote-front:latest
【问题讨论】:
-
您需要使用“repository”和“tag”列中的整个文本作为现有图像名称的一部分:
docker tag mcr.microsoft.com/azuredocs/azure-vote-front:v1 ...。这可能与您提供的名称docker build -t匹配,并且您可以在那里直接指定目标注册表(可能带有多个-t选项)。