【问题标题】:What are the risks to Google Container Registry if the project name is changed?如果项目名称更改,Google Container Registry 会有哪些风险?
【发布时间】:2020-01-21 00:00:16
【问题描述】:

我配置了一个 CI/CD 管道,如果带有特定标签,Google Cloud Build 会自动从推送到 GitHub 存储库的代码构建容器。容器会自动存入 Google Container Registry。注册表中的每个容器都被标记为us.gcr.io/project_name/container_name:tag_name

形式的标签

我的问题是,如果我更改项目名称,这将如何影响我已经用当前项目名称标记的当前位于 Google Container Registry 中的容器?在更新项目名称本身之前,我是否需要使用预期的项目名称更改每个容器上的标签?这是由 GCP 自动处理的吗?

【问题讨论】:

    标签: github google-cloud-platform google-cloud-build google-container-registry


    【解决方案1】:

    Registries in Container Registry are named by the host and project ID。要使用图像(例如推送、拉取、删除),请使用以下格式识别图像:

    [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]

    或 [HOSTNAME]/[PROJECT-ID]/[IMAGE]@[IMAGE_DIGEST]

    即使您更改了项目名称,也无法更改项目 ID,因为Project ID: a unique identifier for your project, composed of the project name and a randomly assigned number。因此,您的映像与 Container Registry 中的相同注册表保持一致。 us.gcr.io/project_id/container_name:tag_name

    【讨论】:

    • 感谢您的回答。我很困惑,因为我的项目 ID 被命名为我的项目名称的小写版本。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-11
    • 2014-07-05
    • 1970-01-01
    • 2011-04-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多