Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
packer-builder-arm is using qemu in order to emulate the arm target platform when provisioning arm machine images.
The Docker Container therefor contains embedded qemu binaries and some setup code to register those when using the container. This integration didn't work and that was not caught by the Github workflows due the
docker/setup-qemu-action
always being running as part of the docker workflow. The usage ofdocker/setup-qemu-action
enables two things: 1. building multi-arch containers 2. running binaries of other platforms inside a container. The later should be covered by the qemu binaries+setup we integrated into the container. By setting updocker/setup-qemu-action
only when we build+push multi-arch containers on the master-brach/release, we get the qemu integration tested during PR test builds. So we get that tested, but how to resolve the issue of the not working qemu integration?This are afaik the most used qemu binaries:
docker/setup-qemu-action
. They maintain there own patches and it also works in our case by using the action or running the container before the packer run. But copying the binaries into our container did not work so far (why?).update-binfmts
to register the binaries does not registerqemu-arm-static
in case of a linux-aarch64 host, which leads to packer again not working.What this PR now does is combining the binaries from 3. with registering also the qemu-arm-static binary on linux-aarch64 like done by 1.
The resulting container should now work on the following platforms
docker/setup-qemu-action
(= locallydocker run --privileged --rm tonistiigi/binfmt --install all
)docker run -e SETUP_QEMU=false --rm --privileged -v /dev:/dev -v ${PWD}:/build --entrypoint /bin/bash -it mkaczanowski/packer-builder-arm
Found by the experiments in #249
cc: @benalexau @openoms who reported this.
fixes: #244
fixes: #245