[英]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.