【问题标题】:Docker image with TAG带有 TAG 的 Docker 映像
【发布时间】: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 选项)。

标签: image docker tags


【解决方案1】:

先验证图片是否存在,

docker image ls

如果存在,则使用它的图像 id 创建一个新标签,

docker tag <image_id> TARGET_IMAGE[:TAG]

更多详情, https://docs.docker.com/engine/reference/commandline/tag/

【讨论】:

  • 谢谢大家,使用的路径未完成。
猜你喜欢
  • 2021-11-22
  • 1970-01-01
  • 2017-07-27
  • 2016-12-11
  • 1970-01-01
  • 2017-12-04
  • 2019-12-17
  • 2020-11-18
  • 2021-10-30
相关资源
最近更新 更多