azure - 有没有办法防止覆盖 Azure 容器注册表中的现有标签/图像?

标签 azure docker azure-devops docker-registry azure-container-registry

我在 Azure Devops 中有一个管道,它的任务是将 Docker 镜像推送到 Azure 容器注册表。我想知道是否有办法阻止此任务覆盖任何现有的 Docker 标签/图像。

最佳答案

the documentation

By default, a tagged image in Azure Container Registry is mutable, so with appropriate permissions you can repeatedly update and push an image with the same tag to a registry. Container images can also be deleted as needed. This behavior is useful when you develop images and need to maintain a size for your registry.

However, when you deploy a container image to production, you might need an immutable container image. An immutable image is one that you can't accidentally delete or overwrite.

使用 Azure CLI,按标签锁定单个图像:

az acr repository update \
--name myregistry --image myrepo/myimage:tag \
--write-enabled false

您还可以锁定整个存储库:

az acr repository update \
--name myregistry --repository myrepo/myimage \
--write-enabled false

还有一个 --delete-enabled 参数来防止图像或存储库被删除(尽管它们仍然可以被覆盖。)

关于azure - 有没有办法防止覆盖 Azure 容器注册表中的现有标签/图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62539266/

相关文章:

powershell - Azure 自动化 Powershell 脚本 - 它们会像 SQL 代理作业一样线性运行吗?

amazon-web-services - meteor 在本地或AWS主机上构建

docker 容器上的 phantomJS

azure - 在发布期间更新 Azure DevOps 发布管道变量

c# - 在 .NET 后端移动服务的 InsertAsync 期间引发 HttpResponseException

c# - 在 Azure 服务器和 UWP 客户端上实现 WebSocket

powershell - 是否有用于测试 Azure Web 应用程序 URL 的 cmdlet?

docker - 在为Microsoft SQL存储过程构建docker镜像时,我超出了最大深度

continuous-integration - 如何使用自定义 NuGet 提要在 VSTS 上运行 dotnet 测试?

azure-devops - 默认取消选择阶段