简体   繁体   English

Google Cloud Container Registry 子目录创建

[英]Google Cloud Container Registry Subdirectory Create

I have an image in registry1 and want to copy it over to a registry2 .我在registry1中有一个图像,想将其复制到registry2中。

Assuming I would get that done by running this command (as stated here ):假设我将通过运行此命令来完成操作(如此处所述):

gcloud container images add-tag \ gcr.io/registry1/image1:tag1 \ gcr.io/registry2/subdirectory/image1:tag1

But I want to create a new subdirectory within the registry2 it's being moved such as:但是我想在正在移动的 registry2 中创建一个新的子目录,例如:

gcr.io/registry2/subdirectory/image1:tag1 how can I create it? gcr.io/registry2/subdirectory/image1:tag1如何创建它?

Also, I'm super new to GCR.另外,我是 GCR 的新手。 Are these called subdirectories, folders?这些叫子目录、文件夹吗?

These are called repositories not folders or directories!这些称为repositories而不是文件夹或目录! Seehere .这里

BTW, Google Container Registry (gcr) doesn't provide full control on these repositories , moreover, you can't assign specific IAM role/s to specific repository .顺便说一句,Google Container Registry (gcr) 不提供对这些repositories的完全控制,此外,您不能将特定的IAM角色分配给特定的repository to get these options, move to Artifact Registry .要获得这些选项,请转到Artifact Registry


To create a repository in gcr , you need to have write access to the registry.要在gcr中创建存储库,您需要对注册表具有写入权限。 and don't do it with gcloud, I mean don't re-tag the source image while it is still in your source repo.并且不要使用 gcloud 执行此操作,我的意思是当源图像仍在您的源代码库中时不要重新标记它。

To do that, just pull the source image locally and then re-tag it using docker with the full tag为此,只需在本地拉取源图像,然后使用带有完整标签的docker重新标记它

gcr.io/registry2/repository/image1:tag1

then push it and that's it!然后推它就是这样! your image should be pushed to the destination repository in registry2 .您的图像应该被推送到registry2中的目标存储库。 See Pushing an image to a registry请参阅将图像推送到注册表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 谷歌云:Artifact Registry 与 Container Registry - Google Cloud: Artifact Registry vs Container Registry Google Cloud Container Registry/Artifact Registry 权限 - Google Cloud Container Registry/Artifact Registry Permissions Google Cloud Container Registry - 检查图像大小 - Google Cloud Container Registry - Check image size 使用谷歌云代码在 vscode 中指定本地 docker 容器注册表 - Specifying local docker container registry in vscode using Google Cloud code 如何使用 yaml 文件将 Google Cloud Build 上的构建发布到 Google Container registry - How to publish a build on Google Cloud Build to Google Container registry using yaml file 谷歌云容器注册表错误:“无法触发构建:请求包含无效参数。” - google cloud container registry error: "Failed to trigger build: Request contains an invalid argument." 访问 Docker 文件中的 Google Cloud 注册表 - Access to Google Cloud registry in Docker file Docker 图像无法在 Google Container Registry 上构建 - Docker image fails to build on Google Container Registry 查找 Google Container Registry 公共映像列表 - Find the list of Google Container Registry public images Google Cloud Builder - 如何触发子目录中的构建配置? - Google Cloud Builder - how to trigger build configuration in a subdirectory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM