-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to build on Mac with Intel CPU? #130
Comments
I had the same issue. Digging in a bit, I found the following... The problem:
Needs Analysis:
Solution
SummaryI'm debating whether or not to invest the time creating a fix here. I thought I would share my findings to help others. If I get time to put toward this, I will send a PR to this repo. |
I don't have a Mac, so can't help here. Depending on the complexity I'd go with a special handlers/steps for MacOS X (it could be as simple as finding equivalent tooling on mac or as hard as changing the whole flow). |
I understand why this won't run natively on macOS due to the dependency on
Might that be a simpler issue to fix? I'm actually hitting this exact same error with the Docker and Vagrant builds on packer-plugin-arm-image too. |
Welp, think I figured this out. When using the Docker build, it appears the local directory is not linked into the Docker container (which is probably fine/expected), but this means the plugin binary must be installed to the
Adding support for the Packer 1.7 Actually, looking more closely at the Dockerfile, this might be an issue with a newer version of Go or specific to macOS - packer-builder-arm/docker/Dockerfile Line 52 in 0eff8b7
./build - running go build on my machine instead puts the binary into the repo root.
|
Can you elaborate on what to do for Mac using Docker? I'm running into this issue and struggling to figure out how to get things to work. |
This is working for me on an M1 Mac
|
@cristian-rivera I am curious what your container runtime is? I am trying to replicate but can not. On an x86 mac, running colima, oddly either with x86 virt or arm64 virt:
docker run --rm --privileged -v /dev:/dev -v ${PWD}:/build packer-builder-arm build boards/raspberry-pi/raspbian.json
uname -a: Linux c8e005bcaf75 5.10.109-0-virt #1-Alpine SMP Mon, 28 Mar 2022 11:20:52 +0000 aarch64 aarch64 aarch64 GNU/Linux
{
"supported": [
"linux/arm64",
"linux/amd64",
"linux/riscv64",
"linux/ppc64le",
"linux/s390x",
"linux/386",
"linux/mips64le",
"linux/mips64",
"linux/arm/v7",
"linux/arm/v6"
],
"emulators": [
"qemu-i386",
"qemu-mips64",
"qemu-mips64el",
"qemu-ppc64le",
"qemu-riscv64",
"qemu-s390x",
"qemu-x86_64"
]
}
running /bin/packer build boards/raspberry-pi/raspbian.json
Error: Failed to initialize build "arm"
error initializing builder 'arm': fork/exec /build/packer-builder-arm: exec
format error
==> Wait completed after 273 microseconds
==> Builds finished but no artifacts were created. Do you perhaps get an |
There have been bugs regarding the Docker container not really be multi-arch in the past (wrong base go image), but those have been fixed some time ago. Tried the example of the README and this works here on multiple M1 and Intel Macs: Can you all try that and report back with log in case there are still issues? |
Spent more time with above mentioned ideas and proposed solutions and compiled a README usage and scripts update #232 to debug, explain and avoid/prevent the error |
Hi! I am trying to build by instruction but something going wrong:
Am i missed something?
brew install losetup
get nothing. What additional dependencies i need to install?Also, i tried build with docker (i have Docker on Mac installed):
Any help would be appreciate!
The text was updated successfully, but these errors were encountered: