-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add support for building multi-arch docker images with paketo #491
Comments
We do have ARM64 support. It is new and not totally complete across all buildpacks at this point in time. You're using Java buildpacks and those are all updated, so you should be OK. The trick at this point is that you need to use a specific builder. Not all of the Paketo builders support ARM64. The builder you want to use is The other point to note is that this is a "buildpackless" builder, so there are no buildpacks installed on the builder by default. This is intentional, but it means you need to supply a list of buildpacks you want to use when you perform your build. With With the Spring Boot build tools, check out the previous two links above for steps to set buildpacks too. To confirm it's building arm64, watch the build output and look at the JVM it's installing. You should see it install an ARM64 compatible-JVM. For what it's worth, there is no cross-compilation support with either pack or Spring Boot build tools. So if you want an ARM64 image, you need to build on a Mac m-series machine, an ARM64 VM or some other ARM64 system. Hope that helps! |
Hi @dmikusa Thanks for getting back. After making changes as mentioned, seeing following errors
build config
bootbuildImage logs
Can you please take a look? problem is my cicd runners are on both ARM64 & AMD64 machines (same about my deployment servers). so if there is no cross-compilation support i.e. not generate multi-arch builds, it will surely fail on releases. Can you please provide workarounds for this? many thanks |
First thing, you've got some layers that were cached. Usually, caching is good and makes things faster. But in this case, it's not updating those cached layers with ARM64 binaries. I'll open a bug for that, cause it should consider the architecture in that caching decision, but for now, just delete your existing app images and the build cache.
or you can change the image name, that will trigger a fresh build too. I suspect that's going to fix your issue here. It'll give you a build that's consistently all arm64. To your other question, what you can do is to build twice. Once for each architecture. Push those images to a registry as separate images. Then you can use the I'm hoping that in the future we'll have some support for that in |
Thanks for checking and providing insights @dmikusa . I saw something related to this here buildpacks/pack#1570 and hopping this can be adopted |
In mac M1, generated an image for testing SB 3.3 + CDS support using packeto buildpack which is part of bootBuildImage stage. This generated image is given following warning in mac M1 but able to run the app. But if I run the same image on cloud VM which is of type ARM64, it is giving following error and immediately existed with error
exec /cnb/process/web: exec format error
.WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Docker supports, multi arch build with specified arch types so wondering when this can be added to paketo build packs.
The text was updated successfully, but these errors were encountered: