(Warning, Newbie here) I’m learning Packer by building a VM. I followed links to cloud-builders-community/packer example. Unfortunately this seems to be out of date. It pushes the output to gcr.io … which I’m discovering is being deprecated in favour of Artifact Registry. It’s also using YAML instead of HCL2.
Is this old code and is there an up to date equivalent somewhere else?
Assuming I can or should continue using this sample code…
I’m confused about a couple things. Artifact Registry : Create Repository has options for Docker, Maven, etc. but does not have an option for VM images. Do I just choose Docker?
Then in cloud-builders-community/packer/cloudbuild.yaml what path do I use to replace gcr.io? gcr.io appears multiple times.
https://github.com/GoogleCloudPlatform/cloud-builders-community/packer/cloudbuild.yaml
steps:
- name: 'gcr.io/cloud-builders/wget'
args: ["https://releases.hashicorp.com/packer/${_PACKER_VERSION}/packer_${_PACKER_VERSION}_linux_amd64.zip"]
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/packer:${_PACKER_VERSION}',
'-t', 'gcr.io/$PROJECT_ID/packer',
'--build-arg', 'PACKER_VERSION=${_PACKER_VERSION}',
'--build-arg', 'PACKER_VERSION_SHA256SUM=${_PACKER_VERSION_SHA256SUM}',
'.']
substitutions:
_PACKER_VERSION: 1.7.8
_PACKER_VERSION_SHA256SUM: 8a94b84542d21b8785847f4cccc8a6da4c7be5e16d4b1a2d0a5f7ec5532faec0
images:
- 'gcr.io/$PROJECT_ID/packer:latest'
- 'gcr.io/$PROJECT_ID/packer:${_PACKER_VERSION}'
tags: ['cloud-builders-community']