gpt4 book ai didi

rest - 通过 REST 处理 Azure 容器注册表中的图像

转载 作者:行者123 更新时间:2023-12-02 18:44:38 25 4
gpt4 key购买 nike

有没有办法使用 REST API 操作 Azure 容器注册表中的镜像(删除、重新标记等)? an existing question的答案仅提及 CLI。

最佳答案

答案是 ACR 实现了 Docker Registry API ,因此此处列出的所有命令也适用于 Azure 注册表中的图像。这与资源管理器 REST 接口(interface)不同,后者用于对注册表本身进行操作。

为了进行身份验证,ACR 文档中列出了各种选项,包括通过 AAD 或使用用户名/密码:https://github.com/Azure/acr/blob/master/docs/AAD-OAuth.md

例如,以下是来自 AAD-OAuth.md 的脚本,用于列出注册表中的所有图像/存储库:

#!/bin/bash

export registry=" --- you have to fill this out --- "
export user=" --- you have to fill this out --- "
export password=" --- you have to fill this out --- "

export operation="/v2/_catalog"

export credentials=$(echo -n "$user:$password" | base64 -w 0)

export catalog=$(curl -s -H "Authorization: Basic $credentials" https://$registry$operation)
echo "Catalog"
echo $catalog

关于rest - 通过 REST 处理 Azure 容器注册表中的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51923836/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com