Skip to content
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

Multi-platform Docker image for Forest #2476

Closed
LesnyRumcajs opened this issue Jan 27, 2023 · 2 comments · Fixed by #2552
Closed

Multi-platform Docker image for Forest #2476

LesnyRumcajs opened this issue Jan 27, 2023 · 2 comments · Fixed by #2552

Comments

@LesnyRumcajs
Copy link
Member

LesnyRumcajs commented Jan 27, 2023

Issue summary

Currently, we offer a Forest image for linux/amd64, which should work on Mac M1, provided certain virtualization prerequisites are installed and configured. This may get a bit messy, and the out-of-the-box experience for the user should be better than that.

This can be done easily with QEMU; unfortunately, the cross-compilation duration using this utility is way too slow - around 30-40 minutes using the best buildjet worker. A native build (as suggested by @elmattic, thanks) on a regular machine takes only 10 minutes.

It would be fantastic to do two native builds, one for amd64 and another for arm64 and end up with a single, multi-platform image. The alternative is to have multiple tags and achieve multi-platform capacity this way, e.g. latest-arm, v0.6.0-arm. Easy to implement, but not the best experience we can offer.

Other information and links

A failed attempt can be found here #2475. In the end, I managed to produce a working native image for M1, but it's far from a perfect solution.

@LesnyRumcajs
Copy link
Member Author

Another trick is to reuse built binaries from other workflows to avoid re-compilation. The YAML files might get complex, though.

@LesnyRumcajs
Copy link
Member Author

LesnyRumcajs commented Jan 27, 2023

For reference https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ (it gives more precise instructions for Go, but it seems like a good reference).

Rust guide that will probably do the trick https://blog.container-solutions.com/building-multiplatform-container-images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant