Repository navigation
Distributed builds #2
Description
Activity
We started to enhance distributed builds in build-push-action and bake-action using reusable workflows some time ago:
- reusable workflow to distribute multi-platform builds build-push-action#1321
- reusable workflow to distribute multi-platform builds bake-action#302
It would be straightforward to use and would avoid GitHub artifacts to export digests: https://deploy-preview-22163--docsdocker.netlify.app/build/ci/github-actions/multi-platform/#distribute-multi-platform-build-across-runners
We didn't release these reusable workflows yet because we wanted secure reusable workflows first.
I took the opportunity to publish these reusable workflows for build and bake in my personal account:
- https://github.com/crazy-max/.github?tab=readme-ov-file#build-distribute-mp
- https://github.com/crazy-max/.github?tab=readme-ov-file#bake-distribute-mp
They are currently used on some repos:
- https://github.com/moby/vpnkit/blob/e54af5cddf60a7a404eba5e9d6928795f55e03a3/.github/workflows/bin-image.yml#L29
- https://github.com/anonaddy/docker/blob/6697c7ce5c6dac94a567fae40b5acae6dd3e818d/.github/workflows/build.yml#L25
- https://github.com/crazy-max/docker-7zip/blob/c3d8b7c2dad793d49f71502aad5a9938c8c473ee/.github/workflows/build.yml#L23
Also still waiting for approval on:
- ci: distribute multi-platform bin-image build buildx#3005
- ci(bin-image): use distribute reusable workflow moby/moby#49474
Currently it takes almost 20min to build the bin image on Buildx repo: https://github.com/docker/buildx/actions/runs/13401108061/job/37432288863
With this reusable workflow to distribute multi-platform builds it's ~3min
Atm we need to use the Path context as there is an issue to keep fetch tags with Git context and Bake: docker/actions-toolkit#677 (comment)
As Git context is a requirement for our reusable workflows we need moby/buildkit#5974 first.
Related to docker/build-push-action#1022 we would need to manage annotations correctly. If user wants annotations on index then it should set them in
buildx imagetools createinmergejob, otherwise set them to each manifest. Would need specific logic for this I think.Related to docker/build-push-action#1022 we would need to manage annotations correctly. If user wants annotations on index then it should set them in
buildx imagetools createinmergejob, otherwise set them to each manifest. Would need specific logic for this I think.Similar to docker/metadata-action#534
- changed the title
[-]Reusable workflows distributed builds[/-][+]Distributed builds[/+]on Aug 18, 2025 Started to work on distributed builds across runners with bake in #22


Currently users rely on a complex workflow to distribute builds across runners: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
For example with
build-push-action:It often leads to confusion with already complex workflows which a reusable workflow could solve.