简体   繁体   English

如何通过 REST API 修改 azure 容器注册表上的图像标记?

[英]How to modify image tag on azure container registry via rest API?

Probably I am not able to follow the azure docs quickly, every single time when I try to implement something from azure API, it is always frustrating me.可能我无法快速遵循 azure 文档,每次尝试从 azure API 实现某些东西时,总是让我感到沮丧。 I feel like an idiot.我觉得自己像个白痴。 This feeling I have every time when read azure docs.每次阅读 azure docs 时都会有这种感觉。 Ie I want to modify or add a new tag azure container registry and here is the docs .即我想修改或添加一个新的标签天蓝色容器注册表,这里是文档 Could someone understand what is the new tag or what will be modified?有人能理解什么是新标签或将修改什么吗?

curl -SsLf -XPATCH -H "Authorization:Basic $TOKEN"  "https://my.azurecr.io/acr/v1/myrepo/_tags/latest"

I am trying to retag the latest tag as 123456789 .我正在尝试将latest标签重新标记为123456789 Any idea how can I handle this?知道我该如何处理吗?

The response:响应:

HTTP/1.1 400 Bad Request

For Workround you can use this API to update the tag of container registry(Make sure to pass the existing tag and new tag as well which you are going to update else it will overwrite with new tag).对于 Workround,您可以使用此 API 更新容器注册表的标签(确保传递现有标签和新标签以及您将要更新的标签,否则它将被新标签覆盖)。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}?api-version=2019-05-01

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

Same you test out using this Microsoft Document : https://docs.microsoft.com/en-us/rest/api/containerregistry/registries/update#code-try-0同样,您使用此 Microsoft 文档进行测试: https ://docs.microsoft.com/en-us/rest/api/containerregistry/registries/update#code-try-0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过REST使用Azure Container Registry中的图像 - Working with images in Azure Container Registry via REST 如何从 Azure 容器注册表中删除映像 - How to delete image from Azure Container Registry 防止覆盖 Azure 容器注册表中的 Docker 映像标记 - Prevent overwrite of Docker image tag in Azure Container registry Azure - 通过 ARM REST api 从注册表运行二头肌 - Azure - Run bicep from registry via ARM REST api 使用 Azure 容器注册表 python API 列出图像标签 - List image tags in using Azure Container Registry python API 如何从Docker注册表中提取容器映像以部署Azure容器 - How to pull container image from docker registry to deploy azure container Azure 容器实例 Python API - 无法从 Azure 容器注册表获取映像 - Azure Container Instances Python API - fails to fetch image from Azure Container Registry 如何从现有的 azure 容器注册表中拉取镜像? - How to pull image from existing azure container registry? Azure 容器注册 | 如何在 azure 管道内为我的 docker 标签图像和我的 ACR 获取相同/当前版本的 Git 标签回购? - Azure Container Registry | How do I get the same/current versioning Git Tag Repo for my docker tag image and my ACR, inside of the azure pipeline? 如何从 Azure 容器注册表中的映像创建 Dockerfile? - How can I create a Dockerfile FROM an Image in Azure Container Registry?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM