Source_image value, when source_image_family is used, at runtime

28 views
Skip to first unread message

Codrin H

unread,
Jul 18, 2023, 9:17:18 AM7/18/23
to Packer
Hi,

Is it possible to output in anyway the image_name that was used at runtime from the source_image_family ?

What I want to achieve: 

I'm using packer with GCP to create compute instance images that have as source_image_family a golden image.

I would like to create a label on the new created image where to mention the source_image name that was used in my build. ( source_image_family will use the latest image )

I was wondering if I could get this information ( source_image ) that packer used during the build ( will add the  tag the new image in post build with gcloud )

PS: I know that I can pass the source_image as packer variable by querying the latest image using gcloud , but I would prefer not to do that, if Packer can.

Thank you. 
Reply all
Reply to author
Forward
0 new messages