Looking for a way to use the gcloud commandline to get the tags of container engine registry images.
this command
cloud docker search gcr.io/PROJECT/myimage
returns
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
PROJECT/myimage 0
but i want to see the tags used so far like the gcloud web console shows.
the machine I run this command on pulls images from docker hub, tags them, then pushes them to google container engine with gcloud docker push...
I suspect I may be asking how to make the local docker client do commands against both google repo and docker hub repo so I can get docker images
listings
****** UPDATE: see https://stackoverflow.com/a/38061253/201911 for this capability in the latest release.
Tag image with registry name This configures the docker push command to push the image to a specific location. The registry name format is: gcr.io/[PROJECT-ID]/[IMAGE] where [PROJECT-ID] is your Google Cloud Platform Console project ID and [IMAGE] is your image's name. You are now ready to push your image to GCR!
Let me tell you hack to relieve your pain:
ZONE=eu
PROJECT_ID=testproject
PROJECT_URL=gs://${ZONE}.artifacts.${PROJECT_ID}.appspot.com/containers/repositories/library
# this generates images list
gsutil ls $PROJECT_URL | sed -e 's#/$##' -e 's#.*/##'
IMAGE_URL=gs://${ZONE}.artifacts.${PROJECT_ID}.appspot.com/containers/repositories/library/${IMAGE_NAME}/
# this generates tags list for specified image
gsutil ls $IMAGE_URL | sed -n '/\/tag_/ { s#.*/tag_##p }'
This will serve you in most of the cases. You will need read permissions to list files in that specific storage bucket in GCE.
gcloud container images list-tags gcr.io/PROJECT/myimage
https://cloud.google.com/sdk/gcloud/reference/container/images/list-tags
This is not currently possible with gcloud
. gcloud docker
is just a wrapper around the docker
command line tool, which doesn't easily expose the information you'd like for remote repositories.
At some point in the future, gcloud
may support this feature.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With