-
Notifications
You must be signed in to change notification settings - Fork 56
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
Doesn't Support Multi-Platform Builds w/ Platform Native Runners #268
Comments
So, it appears that the images aren't actually being created and/or kept if you don't push the images. This makes the GitHub Action completely unusable to properly use native platforms for creating multi-platform builds. |
After further review of the Dev Container build process it appears that the image is already being copied to a
I believe this may actually solve my issue where I should be able to just move & rename the archive to where I need it for artifact upload. |
So, this doesn't work. The output format created by the devcontainer CLI is |
That last step is a bit of dockerhub trickery that isn't guaranteed to work in all registries. It relies on the fact that dockerhub automatically untags (but doesn't delete) prior images when a new image is pushed to the same tag, so YMMV.
An example: # in amd64 runner
devcontainer build ... --image-name foo:123 && <upload to artifact storage>
# in arm64 runner
devcontainer build ... --image-name foo:123 && <upload to artifact storage>
# in follow-on job that pushes the images and manifest:
# load the amd64 variant of `foo:123`
docker load --input "amd64.tar"
# push the local image to the registry and save the remote hash
hashes+=("$(docker push foo:123 | tail -n1 | cut -d' ' -f3)");
# load the arm64 variant of `foo:123`
docker load --input "arm64.tar"
# push the local image to the registry and save the remote hash
# this overwrites the tag from pushing the amd64 variant
hashes+=("$(docker push foo:123 | tail -n1 | cut -d' ' -f3)");
# create and push the manifest
# this overwrites the tag from pushing the arm64 variant
docker buildx imagetools create --tag foo:123 ${hashes[@]}; |
@timnolte You can pass a comma-separated list of platforms to the action: |
@chrmarti the problem is being able to use native GitHub Action Runners for the architecture. Using that method requires QEMU and emulation which burns up tons of time, as in allotted GitHub Action Runner minutes, because the emulation is extremely slow. I ended up having to setup separate steps, that target using a native runner using a matrix build. Then I had to manually use Docker https://github.com/ndigitals/wp-dev-container/blob/develop/.github/workflows/release-build.yml It would sure be nice to pass to this GitHub Action the native runners and it would be able to do all of this automatically but it is a huge complicated setup in order to produce multiplatform images, as it also won't work just adding the comma separated list without also adding a QEMU setup for the required emulation to make it work. |
@timnolte That is an interesting solution, thanks for sharing! I'm not sure the action could spawn a runner for the other platform itself, spawning runners appears to be only possible as part of the workflow file's |
I'm trying to pre-build an image that supports both amd64 & arm64, additionally I'm generating a large matrix of versions(12 image variations will be built). My goal is to build the amd64 version of the images on native GitHub Runners and then the arm64 version of the images on a self-hosted arm64 GitHub Runner. There is some documentation about attempting this however I'm finding it a challenge to find the build results locally in the runners so that I can upload them for a later job that will generated the multi-platform manifest.
Here is the part of my workflow where I'm attempting to use skopeo to pull the container image to then upload as an artifact.
https://github.com/ndigitals/wp-dev-container/blob/fix/Container-Image-Copy/.github/workflows/release-build.yml#L79-L107
The text was updated successfully, but these errors were encountered: