Packer build fails with Error: Unknown source

Looking for a bit of help with packer… The issue I’m having is that Packer doesn’t recognize the source I’m using:
In a file called sources.pkr.hcl:

source "arm-image" "k8s" {
  iso_url = "https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-05-28/2021-05-07-raspios-buster-arm64-lite.zip"
  iso_checksum = "sha256:868cca691a75e4280c878eb6944d95e9789fa5f4bbce2c84060d4c39d057a042"
  output_filename = "../output-arm-image/k8s.img"
  target_image_size = 3*1024*1024*1024
  qemu_binary = "qemu-aarch64-static"
}

In the main build file, build.pkr.hcl

build {
  sources = [
    "source.arm-image.k8s"
  ]
...
}

Error is: Error: Unknown source arm-image.k8s

The command I’m running is just “packer build build.pkr.hcl”. These files are in the same directory. Ideas?

on line 0:
(source code not available)

Known:

Are you including some sort of external builder? Otherwise arm-image isn’t a built in type. You have to use one of the types that packer knows or have a plugin that adds that function in.

From the rest of the source I imagine you want the source to be “qemu”, not “arm-image”.

Ah I realized I missed an important part. There’s also a plugins file:

packer {
  required_plugins {
    arm-image = {
      version = ">= 0.2.5"
      source  = "github.com/solo-io/arm-image"
    }
  }
}

@aram

Btw, this is in a docker container as described in the plugin. I was able to run init from inside the container and got:

Installed plugin github.com/solo-io/arm-image v0.2.5 in "/root/.config/packer/plugins/github.com/solo-io/arm-image/packer-plugin-arm-image_v0.2.5_x5.0_linux_amd64"

however, still getting the same error as before.