List only private Dataproc custom images

Viewed 116

I have created a custom dataproc image using this command ...

$ python generate_custom_image.py --image-name my-ubuntu18-custom --dataproc-version 1.5-ubuntu18 --customization-script my-customization-script.sh --zone us-central-1 --gcs-bucket gs://dataproc-xxxxxx-imgs

After creation, I tried to list all the custom dataproc images created by me and was surprised to see 83 images. Mine was showing up alongside 82 other images. I expected to see only mine. How to ensure mine is not in the public list of dataproc images?

1 Answers

gcloud will by default list private images in your default project alongside a standard list of "public image projects", as listed under the gcloud list help page; you can make it not list public images, but only your project-level private images with the flag --no-standard-images:

gcloud compute images list --no-standard-images

Another way to see the difference is if you have two GCP projects, and you gcloud config set project my-other-project and then try a default gcloud compute images list again, you shouldn't expect to see the custom image you created.

Finally, you can also use:

gcloud compute images describe my-ubuntu18-custom

to see the full resource name of the image along with other metadata, showing that it is nested in your project, and also gcloud compute images get-iam-policy:

gcloud compute images get-iam-policy my-ubuntu18-custom

to assure yourself that the permissions of the custom image are not public.

Related