I want to publish Docker images for both ARM64 and AMD64. My current plan is to run separate CodeBuild projects for each architecture, then use EventBridge to trigger a Lambda function that combines the two architecture-specific images into one multi-platform manifest. The challenge is determining whether both builds succeeded for the same source revision. EventBridge does not appear to support comparing source versions across events, so I may need Lambda to perform that comparison. What is a reliable way to coordinate these builds and create the final multi-architecture image?
3 Answers
If the builds are independent, have each successful build record its commit or source version, architecture, and status in DynamoDB or SSM Parameter Store. A follow-up Lambda can check whether successful ARM64 and AMD64 records exist for the same commit, then create the manifest and mark that version as processed. This gives you the stateful comparison that EventBridge itself does not provide.
You can also tag the images separately, such as `version-arm64` and `version-amd64`, and run a final step that creates a manifest tagged simply as `version` once both images are available. Make sure the final step verifies that both tags refer to the expected source revision before publishing.
You may not need two separate build pipelines. Docker Buildx and BuildKit can build and publish multiple platforms directly by specifying something like `linux/amd64,linux/arm64`. That produces a multi-platform image manifest automatically, although the builder needs access to suitable architecture workers or emulation.

That could simplify the workflow considerably. I was separating the builds mainly to avoid relying on emulation, so I would need to configure native ARM64 and AMD64 builders if I use Buildx.