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

Add support to target non-native architectures #1392

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rmartin16
Copy link
Member

@rmartin16 rmartin16 commented Jul 30, 2023

Changes

Notes

  • A while back, we merged Verify the Docker buildx plugin is installed #1153
  • These changes now leverage buildx to create images for arbitrary machine architectures; using these images, the app can be built for a different arch as though it was that of the host machine
  • However, as I've been learning, this is not without some ambiguity....so, while building/using multi-platform images is relatively straight-forward for a single host machine....supporting varied Docker installs may be a bit trial/error
  • Support for multi-platform images
    • Docker Desktop ships with support for running images for any architecture by virtue of its LinuxKit VM
    • Docker Engine needs this support enabled
      • See current arch support: docker run --privileged --rm tonistiigi/binfmt
      • Add support for arch: docker run --privileged --rm tonistiigi/binfmt --install arm64
      • https://hub.docker.com/r/tonistiigi/binfmt
      • TODO: confirm this is recommended approach for a user's daily driver
      • TODO: does this even work with rootless Docker?
  • Building for the correct arch
    • Docker seems to keep a memory of the last platform used to run a particular container
      • This means it will likely be necessary to always specify the platform to use when running docker....which means Briefcase will need to be able to derive the appropriate default platform for a user's machine when one isn't provided.
      • Ideally, some Docker command can provide this information....since its more complicated than it should be
      • Furthermore, this kinda pollutes the user's environment...definitely best if this could be avoided somehow...
    • Additionally, the build directory will need to be differentiated for the target architecture
      • TODO: include the architecture in the bundle_path

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

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.

Linux / System / Add Support for Targeting Arbitrary Machine Architectures
1 participant