0

I have few images in the GCR of say Project A and want to copy these images to the GCR of Project B using a user account say xyz@gmail.com Is this possible? I also have node js application which uses oauth to authenticate xyz@gmail.com. Earlier I used to do this gcr image copy using shell script where I had used a service account, docker push/pull commands and gcloud container list commands. But now how do I use xyz@gmail.com ie a user account to copy the images in a node application? Is running shell script application from node the only way? Also , if I have to run shell script using node, I will have to install google sdk and authenticate it. But I do not want to perform the same authentication for xyz@gmail.com Please provide some suggestions.

amv
  • 81
  • 8

1 Answers1

0

From Project A shell , give tag for your image

imageProjectA -> Existing Image Name

docker tag imageProjectA test.gcr.io/imageNameProjectB:v1

Push to Gcr

docker push test.gcr.io/imageNameProjectB:v1

Pull from Project B shell

docker pull test.gcr.io/imageNameProjectB:v1

Description:

Give a suitable name of image which is in Porject A shell. Then Push to Gcr. Then From Project B shell Pull that. Allocating a tag name for every image is the main thing you have to consider in docker and the version for every docker push , otherwise it will consider all image in latest version.

Janen R
  • 729
  • 10
  • 21