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

try multiplatform build on PR #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

erikarasnick
Copy link
Member

No description provided.

@erikarasnick
Copy link
Member Author

Without making changes to Dockerfile (only added platform argument to final build), the entire GHA workflow took 4 hr 21 min. Most of this time was spent building the container (specifically renv::restore()) for arm64 since the virtual environment here is amd64 (on my local computer it's opposite). Looking into solutions for compiling the first build then converting to the other platform. I've been using this resource: https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/ but not sure if it is directly applicable yet.

Also, the way it is currently set up, we are building the container 3 times-- once to use for testing, one final build for amd64 and one final build for arm64. As far as I can tell, you can't call a built container when building for multi-platform unless you push it to some repository first (i.e., when I build locally, then run di, it is not there) so I have it building for one platform for testing, then building multi-platform to be pushed to ghcr. I think there are ways to cache the first (test) build to be used for the amd64 final build-- still looking into that.

@erikarasnick
Copy link
Member Author

erikarasnick commented Dec 29, 2022

hmm.. cross-compilation may not be possible in our case. all examples I have seen are for apps built with go, alpine, or rust (??) I'm out of my league 😅

@erikarasnick
Copy link
Member Author

original GHA multi-platform documentation from Cole https://docs.docker.com/build/ci/github-actions/examples/#multi-platform-images

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.

1 participant