I'm trying to push an image that is hosted in another project with that command:
docker login [first account with service-account]
docker pull gcr.io/xxx/xxx/xxx:1.0.0
docker login [other service-account]
docker push gcr.io/yyy/yyy/yyy:1.0.0
and that give me that error: An image does not exist locally with the tag: gcr.io/yyy/yyy/yyy
How I can fix it? I altro tried to tag the image locally but has now worked
You can simply tag your XXX Docker image as YYY, for example:
# Pull image XXX
docker login [first account with service-account]
docker pull gcr.io/xxx/xxx/xxx:1.0.0
# Tag it as YYY
docker tag gcr.io/xxx/xxx/xxx:1.0.0 gcr.io/yyy/yyy/yyy:1.0.0
# Push it on the other account
docker login [other service-account]
docker push gcr.io/yyy/yyy/yyy:1.0.0
Your command fails because Docker does not recognize that gcr.io/yyy/yyy/yyy:1.0.0
is the same as gcr.io/xxx/xxx/xxx:1.0.0
- you must specifically tell-it so by tagging such as above.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.