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 in GCP by anonymous
• 6,650 points
26 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 by Sirajul
• 40,980 points

Related Questions In GCP

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 23 in GCP by Sirajul
• 40,980 points
12 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
37 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
0 votes
1 answer
0 votes
1 answer