Open DavidS-ovm opened 1 year ago
@DavidS-ovm do you have a documented example of how you took the results of the builds and combined them? I'm thinking that my problem right now is that I'm using the devcontainers/ci GitHub Action on dedicated native platform runners but the underlying devcontainer build
command is using an --output type=oci,dest=/tmp/output.tar
flag setup that I think is preventing me from properly using buildx
to created the combined platform manifest/image.
I was of course able to just use QEMU, and like you pointed out wait a long time for builds, but the result is 45+ minute builds instead of like 15 minute builds(my arm64 runners are low on resources).
@timnolte I was using the docker manifest
command as documented in the link in the OP. Eventually I moved on to use https://depot.dev instead. It's a much nicer experience!
When using a buildx builder for multi-arch building that uses actual native hosts (e.g. through kubernetes) to efficiently build on native CPUs,
devcontainer build
fails withfull logs
Workaround
use qemu and patience instead of kubernetes backend
Following the instruction in https://dev.to/aws-builders/using-docker-manifest-to-create-multi-arch-images-on-aws-graviton-processors-1320 I was also able to build the x86 and arm64 images in two separate jobs and then assemble it afterwards in a separate step. Note that docker 20.10 (the default on github runners) is too old for
docker manifest
and I needed to upgrade to a newer version (24.0.0 and 23.0.6 both worked, see https://stackoverflow.com/a/59797984/4918) to get it to work.