Open retgits opened 2 years ago
FWIW, this would be an issue with qemu, see https://github.com/docker/for-mac/issues/5123#issuecomment-784992589.
What we can do, and would need to test, is create an arm64 sample builder image. Marking this as a feature request and updating the title.
Hi Team, I am also interested in Linux/ARM64 support for the cnbs docker images. Do you have any plans to roll out the official Linux/ARM64 docker images soon?
cc @AidanDelaney
I am not on the learning team, but my sense is that we could use some helping hands from folks willing to push this forward incrementally. If anyone would be interested in getting involved, I'd be happy to provide support based on my experience contributing to this repository.
Thank you for the response.
The cnbs images are built and pushed to dockerhub via the Makefile. It seems like we cannot create multi-arch docker images using pack. Pack can build native images for both Linux/AMD64 and Linux/ARM64 separately. So, to build and release images for ARM64 (image names different for amd64 and arm64), Makefile needs to be reframed with platform-specific checks to build and push images for separate platforms (AMD64 and ARM64) and then other files using these images also need to be reframed with platform-specific checks to work for both the platforms. Also, GitHub Actions config files will use self-hosted runners to support the build and push for Linux/ARM64 images.
May I know, is there a way we can build multi-arch images using pack? Or else, IMO, the above requires a lot of changes in the source code in multiple files.
Kindly provide your suggestions on the same.
Continuing with my previous comment, to create the application image for “myapp”, I tried creating the builder image “sample-builder:bionic” natively for Linux/ARM64. However, “myapp” failed with the following logs:
$ pack build myapp --builder sample-builder:bionic
0.14.1: Pulling from buildpacksio/lifecycle
Digest: sha256:56019ba74831e3444f33ee8c0201f18cc300213bac353b8b6a79c7a1669b7a49
Status: Image is up to date for buildpacksio/lifecycle:0.14.1
===> ANALYZING
[analyzer] Previous image with name "myapp" not found
===> DETECTING
[detector] exec /cnb/lifecycle/detector: exec format error
Below are the changes I did in the source code for Linux/ARM64:
Then, I built the sample-builder:bionic via make as below:
$ make build-linux-stacks build-linux-packages build-linux-builders
Do you have any suggestions on the same?
@odidev thank you for looking into this! You are right that we can't create cross-platform builders with pack today; this issue (https://github.com/buildpacks/pack/issues/1459) would change that, but is awaiting someone to take it up.
Regarding the error mentioned above - can you check if the lifecycle in the builder is compiled for arm? The error is either coming from the lifecycle or the buildpack, so we need to ensure both are able to run on arm architecture. I see that the analyzer ran fine, but pack might have been using the "lifecycle image" for that step so we need to confirm what was actually on the builder itself.
Only the very latest lifecycle
has fixes to pick up arm64
builders. We would love some help with https://github.com/buildpacks/docs/issues/533 :)
I followed this document < https://buildpacks.io/docs/app-developer-guide/build-an-arm-app/ > to build the application image on Arm directly by invoking the lifecycle image, and successfully created the application container.
Also, I followed this document: < https://github.com/dmikusa/paketo-arm64#readme > in paketo-arm64 repo to natively build the builder image for Arm and created the application container bound to port 8080. I can curl localhost:8080 successfully.
$ curl -s http://localhost:8080/actuator/health | jq .
{
"status": "UP"
}
@odidev Congratulations on becoming an innovator in the multi-architecture buildpacks space :) If you have the time it would be great to see you in our regular Thursday meetings (https://buildpacks.io/community/). We would appreciate your perspective.
This is a longer term goal for us. We're now in a position that it should work, i.e. we've made all the necessary changes to pack. Keeping this open.
Problem
I tried running the Build an app example in the Buildpack docs, but hit an error while doing so. Any thoughts on how to troubleshoot would be greatly appreciated.
Steps to reproduce
brew install buildpacks/tap/pack
git clone https://github.com/buildpacks/samples
pack build sample-app --path samples/apps/java-maven --builder cnbs/sample-builder:bionic
Outcome / Stack trace
Environment
0.21.1+git-e09e397.build-2823
Docker version 20.10.7, build f0df350