Search code examples
google-cloud-platformdebiancommand-line-interfacedocker-machine

How to get list of all docker-machine images for google cloud


I'm creating docker-machines in Google Cloud with the shell command

docker-machine create --driver google \
     --google-project my-project \
     --google-zone my-zone \
     --google-machine-image debian-cloud/global/images/debian-10-buster-v20191210 \
     machine-name

As you see, i use the image debian-10-buster-v20191210. But I want to switch the version of the image to a less recent one. And the problem is that I can't find the place where the list of such images (debian-10-buster-v*) can be found. Can you please help me to find the place?


Solution

  • Determining a list of available images can be done using the gcloud command line.

    --show deprecated indicates you want to see ALL images, not just the latest
    --filter= only selects images with a starting name of debian-10-buster

        $ gcloud compute images list --filter="name=debian-10-buster" --show-deprecated
        NAME                        PROJECT       FAMILY     DEPRECATED  STATUS
        debian-10-buster-v20191115  debian-cloud  debian-10  DEPRECATED  READY
        debian-10-buster-v20191121  debian-cloud  debian-10  DEPRECATED  READY
        debian-10-buster-v20191210  debian-cloud  debian-10              READY
    

    You can find additional information in the gcloud Images List documentation.