azure - 如何获取特定时间段内未使用(拉取)的ACR图像详细信息?

标签 azure docker azure-container-registry acr

我有两个关于 ACR 图像拉取的问题。

  1. 是否有可能获取 ACR docker 镜像的拉取计数?
  2. 我们能否获取在特定时间段内未拉取的 docker 镜像的详细信息?比如最近7天没有拉取过的镜像?

最佳答案

  1. Is there a possibility to get the pull count of an ACR docker image?
  2. Can we get the details of docker images that are not pulled for a specific time period? For example, the images that are not pulled for the last 7 days?

正如我在上面的评论中提到的,您可以通过在容器注册表上启用诊断设置并将这些日志传递到日志分析工作区来实现此目的。您可以编写一些自定义 kusto 查询并根据您的要求提取日志。

以下查询有助于获取一段时间内从 acr 获取图像的拉取次数。

ContainerRegistryRepositoryEvents| where ArtifactType contains "acr.docker"
|where Repository contains "<repoName>" and Tag contains "<TagName>"
| where OperationName contains "Pull"
| where TimeGenerated > ago(24h)
| count 

您可以引用this更多示例 Kusto 查询的文档。

关于azure - 如何获取特定时间段内未使用(拉取)的ACR图像详细信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70379939/

相关文章:

node.js - docker : MongooseError [MongooseServerSelectionError]: getaddrinfo ENOTFOUND mongo

android - 在Docker中找不到Watchman,但react-native成功构建了 bundle

docker - Docker Compose V2网络错误

azure - Azure 部署中心的 CI/CD 失败,因为存储库名称必须小写

azure - 在azure容器注册表中找不到推送的镜像

Azure Blob 存储 Python API 性能

azure - Sql数据同步失败并且没有可用日志

regex - ACR 清除 - 如何设置正则表达式以跳过清除中以 v 开头的特定图像

使用 vscode 部署 Azure Web 应用程序比 DevOps 管道更快

entity-framework - 表 Controller : Flatten persistent data into DTO