Open 0x1a8510f2 opened 3 years ago
buildx [1] natively supports mullti-arch builds using qemu and I definitely see value in providing this functionality to the broader community. This was a comment I had made in our chatroom a few months ago when this topic came up:
my suggestion would be a new plugin that uses buildx. If someone put together a prototype and can confirm it works on standard aws ec2 virtual machine (not just baremetal) we could consider creating a plugins/buildx image we could try to combine everything into one plugin, but I'm not sure it is necessary. They are really two distinct workflows, so I think they are better as two distinct plugins
The docker plugin is perhaps our most popular plugin and is being used in tens of thousands (hundreds of thousands?) of pipelines. For this reason our primary goal with the docker plugin is to keep it as stable as possible; stability is much more important than new features. Since buildx has very different commands and features, and is still beta and could change significantly, I believe it should be a separate plugin so that we can take full advantage of the buildx features and so that we can avoid disrupting the very stable Docker plugin.
I would definitely support a proposal for the creating of a new buildx plugin that works with Qemu [2]. If approved, we would also need a volunteer to help drive the initial development.
[1] https://docs.docker.com/buildx/working-with-buildx/ [2] https://hub.docker.com/r/jonoh/docker-buildx-qemu (example image with docker and qemu installed)
We'd love to see this supported as an official image. This fork of the docker plugin does work on EC2 images: https://github.com/thegeeklab/drone-docker-buildx
Before docker builds are performed, this command needs to be run on the host to install all platforms to be supported:
docker run --privileged --rm tonistiigi/binfmt --install arm64,arm,aarch64
More info about installing platforms: https://github.com/tonistiigi/binfmt
I writed a blog post to demo how to compile multi-architecture images with Docker BuildKit using Drone CI/CD.
Direct copy+paste from https://github.com/drone-plugins/drone-docker/pull/316:
Alternatively: