【问题标题】:Google Artifact Registry: what's the alternative to artifacts.project-name.appspot.com?Google Artifact Registry:artifact.project-name.appspot.com 的替代品是什么?
【发布时间】:2022-03-02 07:17:13
【问题描述】:

使用 Google Container Registry,可以使用gsutil 列出存储在注册表中的 Docker 层。例如,此命令将计算存储层的总大小(我假设这是计费大小):

gsutil du -hs gs://us.artifacts.project-name.appspot.com/containers/images

Artifact Registry 和 pkg.dev 的替代方案是什么?

我尝试了 python API,虽然我可以使用ListDockerImagesRequest 检索图像大小,但没有关于如何使用/共享图层的信息。有没有办法找到 Artifact Registry 的总计费存储库大小?

    标签: google-cloud-platform gcloud gsutil google-container-registry google-artifact-registry


    【解决方案1】:

    对于 AR,您可以使用 ListFiles 获取存储库中的所有文件。存储库大小只是这些文件大小的总和,这适用于所有存储库类型。 (对于 docker,“文件”包括清单和层)

    ListFiles 的 Api 文档在这里:https://cloud.google.com/artifact-registry/docs/reference/rpc/google.devtools.artifactregistry.v1beta2#listfilesrequest(这里的“父级”是存储库。我会考虑在文档中更清楚地说明这一点)

    【讨论】:

    • 谢谢!我是否正确理解要管理图像,我仍然应该使用来自google.cloud.artifactregistryListDockerImagesRequest?因为据我所知,v1beta2 包括 ListFilesRequest 但不包括 ListDockerImagesRequest
    • 你可以使用任何一个。 ListDockerImages 更特定于 docker,ListFiles 是一个更通用的函数,适用于所有 AR,但不能清楚地映射到 docker 图像(因为文件是清单或层)
    猜你喜欢
    • 2015-07-07
    • 2019-02-22
    • 2011-05-07
    • 2012-04-24
    • 2019-12-03
    • 2010-09-17
    • 2012-03-27
    • 2012-09-30
    • 2010-10-20
    相关资源
    最近更新 更多