Copy an image from one repository to another.

0 votes
How do I copy an image that I have in one repository to another registry?
Nov 14 in GCP by anonymous
• 6,650 points
21 views

1 answer to this question.

0 votes

You can copy an image from one repository into another using the command line. You must have access to both repositories.

To copy an image from one repository into another, use the gcloud container images add-tag command, and identify the image to be moved by its tag:

gcloud container images add-tag \
[SOURCE_HOSTNAME]/[SOURCE_PROJECT-ID]/[SOURCE_IMAGE]:[SOURCE_TAG] \
[DESTINATION_HOSTNAME]/[DESTINATION_PROJECT-ID]/[DESTINATION_IMAGE]:[DESTINATION_TAG]

or its digest:

gcloud container images add-tag \
[SOURCE_HOSTNAME]/[SOURCE_PROJECT-ID]/[SOURCE_IMAGE]@[IMAGE_DIGEST] \
[DESTINATION_HOSTNAME]/[DESTINATION_PROJECT-ID]/[DESTINATION_IMAGE]:[DESTINATION_TAG]

where, for both the source and destination:

  • [HOSTNAME] is the location where the image is hosted, and is one of four options: gcr.io, us.gcr.io, eu.gcr.io, or asia.gcr.io.

  • [PROJECT-ID] is the Google Cloud Platform Console project ID. If your project ID has a colon in it (:) seeDomain-scoped projects.

  • [IMAGE] is the image's name in Container Registry.

  • [IMAGE_DIGEST] is the sha256 hash value of the image contents.

  • [TAG] is the tag that identifies the source image to move, or the tag to apply to the image in the destination repository.

answered Nov 14 by Sirajul
• 40,980 points

Related Questions In GCP

0 votes
1 answer

How to copy an object to a folder in the bucket?

Use the gsutil cp command to create a folder ...READ MORE

answered Oct 23 in GCP by Sirajul
• 40,980 points
12 views
0 votes
1 answer

How to delete a project from Google Cloud Console

First of all, select the project you ...READ MORE

answered Apr 18, 2018 in GCP by kurt_cobain
• 9,280 points
188 views
0 votes
1 answer
0 votes
1 answer

Does Google cloud platform (GCP) offer IaaS ? Or just PaaS?

GCP provides IaaS as well, although it ...READ MORE

answered Sep 20 in GCP by Sirajul
• 40,980 points
168 views
0 votes
1 answer

How do I create a VPCN (Virtual private cloud network) on Google Cloud?

You can connect various GCP resources to each ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
38 views
0 votes
1 answer

Cloud SQL of google cloud is IaaS or PaaS?

Cloud SQL is PAAS (Plaform As A ...READ MORE

answered Sep 23 in GCP by Sirajul
• 40,980 points
60 views