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

Cross-compile for linux/arm64 and push multi-platform Docker images. #518

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

vitropy
Copy link
Contributor

@vitropy vitropy commented Nov 22, 2023

No description provided.

Copy link

vercel bot commented Nov 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
entropy-core ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2023 0:57am

Copy link
Contributor

@ameba23 ameba23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, and i image it was a lot of work so well done.

I don't think i can add much useful feedback, have very little experience with dockerhub and none with compiling for arm64, so leaving this as 'Comment'.

@vitropy
Copy link
Contributor Author

vitropy commented Nov 22, 2023

This looks great, and i image it was a lot of work so well done.

I don't think i can add much useful feedback, have very little experience with dockerhub and none with compiling for arm64, so leaving this as 'Comment'.

Thanks, @ameba23. I probably should have written more in the description of this pull request, but I've been a bit wiped this week. The short version is: try this out and let me know how you fare? You might need an Apple Silicon macOS machine to test the linux/arm64 images, though, but the ultimate intent of this PR is to make sure that a single container image tag name points to an OCI image manifest list as opposed to a single image's manifest. This is visible in the Docker Hub UI by going to one of the new multi-platform images and viewing the OS/platform drop-down:

Screenshot 2023-11-22 at 4 13 16 AM

This way, regardless of whether you're on an Apple Silicon macOS device, or a computer with an Intel x86 chipset, you can just use the same docker image pull ... command and the image appropriate for your platform will be downloaded. 🤞

I ultimately decided to forego simultaneous builds for each platform and instead used Docker BuildKit's built-in multi-platform support because it substantially simplified the CI/CD workflow files without costing much overhead in terms of time build time and without adding (too much) complexity to the Dockerfile itself. All of the CPU-intensive build steps (compiling, etc) are now performed in the build platform's native environment, so we retain the overwhelming majority of the speed boost over using QEMU for building. We still build server and entropy in parallel, as well.

@vitropy vitropy merged commit 0d271b5 into master Nov 22, 2023
10 checks passed
@vitropy vitropy deleted the vi/cross-compile-ci branch November 22, 2023 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants