你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az acr repository

管理 Azure 容器注册表的存储库(映像名称)。

命令

名称 说明 类型 状态
az acr repository delete

删除 Azure 容器注册表中的存储库或映像。

核心 GA
az acr repository list

列出 Azure 容器注册表中的存储库。

核心 GA
az acr repository list-deleted

列出Azure 容器注册表中的软删除存储库。

核心 预览版
az acr repository show

获取 Azure 容器注册表中的存储库或映像的属性。

核心 GA
az acr repository show-manifests

在Azure 容器注册表中显示存储库的清单。

核心 已放弃
az acr repository show-tags

显示 Azure 容器注册表中的存储库的标记。

核心 GA
az acr repository untag

取消标记 Azure 容器注册表中的映像。

核心 GA
az acr repository update

更新 Azure 容器注册表中的存储库或映像的属性。

核心 GA

az acr repository delete

删除 Azure 容器注册表中的存储库或映像。

此命令删除容器注册表中任何其他清单未引用的所有关联层数据。

az acr repository delete --name
                         [--image]
                         [--password]
                         [--repository]
                         [--suffix]
                         [--username]
                         [--yes]

示例

按标记删除映像清单。 这会删除“hello-world:latest”引用的清单,以及引用同一清单的所有其他标记。

az acr repository delete -n myregistry --image hello-world:latest

通过基于 sha256 的清单摘要删除映像清单。 这会删除由“hello-world@sha256:abc123”标识的清单,以及引用清单的所有标记。

az acr repository delete -n myregistry --image hello-world@sha256:abc123

从Azure 容器注册表中删除存储库。 这会删除“hello-world”下的所有清单和标记。

az acr repository delete -n myregistry --repository hello-world

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--image -t

映像的名称。 可以包含格式为“name:tag”的标记,或格式为“name@digest”的摘要。

--password -p

用于登录到容器注册表的密码。

--repository

存储库的名称。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--username -u

用于登录到容器注册表的用户名。

--yes -y

不提示确认。

默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository list

列出 Azure 容器注册表中的存储库。

az acr repository list --name
                       [--password]
                       [--suffix]
                       [--top]
                       [--username]

示例

列出给定Azure 容器注册表中的存储库。

az acr repository list -n myregistry

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--password -p

用于登录到容器注册表的密码。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--top

限制结果中的项数。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository list-deleted

预览

此命令处于预览阶段,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

列出Azure 容器注册表中的软删除存储库。

az acr repository list-deleted --name
                               [--password]
                               [--suffix]
                               [--username]

示例

列出给定Azure 容器注册表中的软删除存储库。

az acr repository list-deleted -n myregistry

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--password -p

用于登录到容器注册表的密码。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository show

获取 Azure 容器注册表中的存储库或映像的属性。

az acr repository show --name
                       [--image]
                       [--password]
                       [--repository]
                       [--suffix]
                       [--username]

示例

获取存储库“hello-world”的属性。

az acr repository show -n myregistry --repository hello-world

获取标记“hello-world:latest”引用的图像的属性。

az acr repository show -n myregistry --image hello-world:latest

获取摘要“hello-world@sha256:abc123”引用的图像的属性。

az acr repository show -n myregistry --image hello-world@sha256:abc123

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--image -t

映像的名称。 可以包含格式为“name:tag”的标记,或格式为“name@digest”的摘要。

--password -p

用于登录到容器注册表的密码。

--repository

存储库的名称。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository show-manifests

已放弃

此命令已弃用,将在将来的版本中删除。 请改用“acr 清单列表元数据”。

在Azure 容器注册表中显示存储库的清单。

az acr repository show-manifests --name
                                 --repository
                                 [--detail]
                                 [--orderby {time_asc, time_desc}]
                                 [--password]
                                 [--suffix]
                                 [--top]
                                 [--username]

示例

在Azure 容器注册表中显示存储库的清单。

az acr repository show-manifests -n myregistry --repository MyRepository

显示Azure 容器注册表中存储库时间戳排序的最新 10 个清单。

az acr repository show-manifests -n myregistry --repository MyRepository --top 10 --orderby time_desc

显示Azure 容器注册表中存储库时间戳排序的最新 10 个清单的详细信息。

az acr repository show-manifests -n myregistry --repository MyRepository --top 10 --orderby time_desc --detail

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

--repository

存储库的名称。

可选参数

--detail

显示详细信息。

默认值: False
--orderby

对结果中的项进行排序。 默认为名称的字母顺序。

接受的值: time_asc, time_desc
--password -p

用于登录到容器注册表的密码。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--top

限制结果中的项数。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository show-tags

显示 Azure 容器注册表中的存储库的标记。

az acr repository show-tags --name
                            --repository
                            [--detail]
                            [--orderby {time_asc, time_desc}]
                            [--password]
                            [--suffix]
                            [--top]
                            [--username]

示例

在Azure 容器注册表中显示存储库的标记。

az acr repository show-tags -n myregistry --repository MyRepository

显示Azure 容器注册表存储库标记的详细信息。

az acr repository show-tags -n myregistry --repository MyRepository --detail

显示Azure 容器注册表中存储库时间戳排序的最新 10 个标记的详细信息。

az acr repository show-tags -n myregistry --repository MyRepository --top 10 --orderby time_desc --detail

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

--repository

存储库的名称。

可选参数

--detail

显示详细信息。

默认值: False
--orderby

对结果中的项进行排序。 默认为名称的字母顺序。

接受的值: time_asc, time_desc
--password -p

用于登录到容器注册表的密码。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--top

限制结果中的项数。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository untag

取消标记 Azure 容器注册表中的映像。

此命令不会删除标记或任何关联的层数据引用的清单。

az acr repository untag --image
                        --name
                        [--password]
                        [--suffix]
                        [--username]

示例

从存储库中取消标记映像。

az acr repository untag -n myregistry --image hello-world:latest

必需参数

--image -t

映像的名称。 可以包含格式为“name:tag”的标记。

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--password -p

用于登录到容器注册表的密码。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--username -u

用于登录到容器注册表的用户名。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az acr repository update

更新 Azure 容器注册表中的存储库或映像的属性。

az acr repository update --name
                         [--delete-enabled {false, true}]
                         [--image]
                         [--list-enabled {false, true}]
                         [--password]
                         [--read-enabled {false, true}]
                         [--repository]
                         [--suffix]
                         [--username]
                         [--write-enabled {false, true}]

示例

更新存储库“hello-world”的属性以禁用写入操作。

az acr repository update -n myregistry --repository hello-world --write-enabled false

更新标记“hello-world:latest”引用的图像的属性,以禁用写入操作。

az acr repository update -n myregistry --image hello-world:latest --write-enabled false

更新摘要“hello-world@sha256:abc123”引用的图像的属性以禁用写入操作。

az acr repository update -n myregistry --image hello-world@sha256:abc123 --write-enabled false

必需参数

--name -n

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--delete-enabled

指示是否允许删除操作。

接受的值: false, true
--image -t

映像的名称。 可以包含格式为“name:tag”的标记,或格式为“name@digest”的摘要。

--list-enabled

指示此项是否显示在列表操作结果中。

接受的值: false, true
--password -p

用于登录到容器注册表的密码。

--read-enabled

指示是否允许读取操作。

接受的值: false, true
--repository

存储库的名称。

--suffix

注册表登录服务器中的租户后缀。 如果注册表登录服务器的格式为“registry-tenant.azurecr.io”,则可以指定“--suffix tenant”。 如果从其他订阅访问注册表,或者你有权访问映像,但无权管理注册表资源,则适用。

--username -u

用于登录到容器注册表的用户名。

--write-enabled

指示是否允许写入或删除操作。

接受的值: false, true
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。