Closed isZumpo closed 3 weeks ago
The Dockerfile has been updated to include the installation of the gcc-aarch64-linux-gnu
package and to modify the build process to accommodate different platforms using the TARGETPLATFORM
argument. This change enhances the Docker build's flexibility and cross-platform compatibility.
Files | Change Summary |
---|---|
Dockerfile | Added gcc-aarch64-linux-gnu package installation and modified build process to handle different platforms using TARGETPLATFORM argument. |
In Docker's world, a change we see,
For platforms wide, with glee and spree.
gcc-aarch64
joins the crew,
To build for many, old and new.
Flexibility now our Docker's might,
A future bright, in code's clear light.
🐇✨
[!WARNING]
Review ran into problems
Problems (1)
* Git: Failed to clone repository. Please contact CodeRabbit support.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
As mentioned in v0.5.4 release discussion
There have been issues running the linux/arm64 image since PR #176 which fixed the linux/amd64 build and introduced improvements to the cross-compilation process by utilizing BUILDPLATFORM. Since this PR cross-compilation provided by the build system will be used rather than emulation in the docker build. Unfortunately, this change does require some more changes to the Dockerfile/makefile to work as expected.
Currently, the arm64 image contains the amd64 binaries. Due to how the Dockerfile calls the make file without an argument, leading to this piece of code to be executed:
which depends on this:
Since this part of the code no longer is being emulated by docker, uname -m will always return x86_64. Causing it to always be built even when --platform arm64 is requested.
This PR fixes that issue by instead calling the correct make target directly from the Dockerfile. Also had to install gcc-aarch64-linux-gnu for cross-compilation support in the dockerfile.
This time I went ahead and tried both arm64 and amd64 to be on the safe side after building with:
docker buildx build --platform=linux/arm64,linux/amd64 --tag test .