Push an image to the container registry

0 votes
I have installed docker on gcp instance and I have an image that I wish to push to the container registry. But I am stuck as to how should I tag an image with the registry name? can somebody help?
Nov 14, 2019 in GCP by anonymous
• 19,610 points
1,008 views

1 answer to this question.

0 votes

To tag the local image with the registry name:

  1. Determine the registry name:

    1. Choose a hostname, which specifies the region of the registry's storage. This region is not your location, but the location where the images will be stored. For example, if you are in Australia, you may want to use the host in Asia.

      The four options are:

      • gcr.io hosts the images in the United States, but the location may change in the future

      • us.gcr.io hosts the image in the United States, in a separate storage bucket from images hosted by gcr.io

      • eu.gcr.io hosts the images in the European Union

      • asia.gcr.io hosts the images in Asia

      In the console, the images' hostname will be listed under Location.

    2. Choose an image name, which can be different from the image's name on your local machine.

    3. Combine the hostname, your Google Cloud Platform Console project ID, and image name:

      [HOSTNAME]/[PROJECT-ID]/[IMAGE]
      
  2. Tag the local image with the registry name by using the command:

    docker tag [SOURCE_IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]

    where [SOURCE_IMAGE] is the local image name or image ID.

    This command names the image with the registry name and applies the tag latest. If you want to apply a different tag, then use the command:

    docker tag [SOURCE_IMAGE] [HOSTNAME]/[PROJECT-ID]/[IMAGE]:[TAG]
answered Nov 14, 2019 by Sirajul
• 59,230 points

Related Questions In GCP

+1 vote
1 answer

How to export a custom image to the cloud storage?

The preferred way to export an image ...READ MORE

answered Oct 18, 2019 in GCP by Sirajul
• 59,230 points
1,977 views
0 votes
1 answer
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 24, 2019 in GCP by Sirajul
• 59,230 points
1,740 views
0 votes
1 answer

Copy an image from one repository to another.

You can copy an image from one ...READ MORE

answered Nov 14, 2019 in GCP by Sirajul
• 59,230 points
2,658 views
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, 2019 in GCP by Sirajul
• 59,230 points
6,551 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, 2019 in GCP by Sirajul
• 59,230 points
1,460 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, 2019 in GCP by Sirajul
• 59,230 points
3,503 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP