Unable to build images with qemu
cunningr opened this issue · 3 comments
What steps did you take and what happened:
- Clone this repo on main into the latest
hashicorp/packer
docker container from Dockerhub - Run
make build-qemu-ubuntu-2204
insideimages/capi
- Packer throws an error about not having the
qemu
provider.
I believe we just need a provider file config.pkr.hcl
in images/capi/packer/qemu
to declare the provider:
packer {
required_plugins {
qemu = {
version = "~> 1"
source = "github.com/hashicorp/qemu"
}
}
}
What did you expect to happen:
The provider should be installed automatically.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
Project (Image Builder for Cluster API: qemu
Additional info for Image Builder for Cluster API related issues:
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.17.0
PRETTY_NAME="Alpine Linux v3.17"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
/ # packer -v
1.8.5
<missing provider for qemu>
/kind bug
[One or more /area label. See https://github.com/kubernetes-sigs/cluster-api/labels?q=area for the list of labels]
apologies - you're right (I was trying to fix multiple things at the same time):
docker run --entrypoint /bin/sh -it hashicorp/packer:latest
/ # packer -v
Packer v1.10.0
I took the latest packer to try and satisfy the latest Ansible constraint 2.15.8
:
https://github.com/kubernetes-sigs/image-builder/blob/main/images/capi/hack/ensure-ansible.sh#L26
but I still had to bump the apk repo version:
RUN sed -i 's/v3.18/v3.19/g' /etc/apk/repositories
Although it looks like image-builder
should take care of installing packer for us *if it is not there. In our case we were starting FROM hashicorp/packer:latest
so I guess we should fix this our end.
Thanks for your help!
No worries, you're not the first to hit this. I've opened #1379 to look at how we could handle this and restrict the versions allowed to try and avoid this confusion for others. :)
If you use our provided container image as the base (e.g. registry.k8s.io/scl-image-builder/cluster-node-image-builder-amd64:v0.1.22
) it should contain all the versions you'd need. This is how I work with image-builder
.