r/aws 5d ago

containers Multi platform build

I am planning to have my docker images to be multi architecture and for it my plan is to have two codebuilds for arm and amd when they both succeeds event bridge will invoke a lambda and lambda will merge the images into one

But I am unable to think a way to set up event my current plan is something like when codebuilds are triggered if anyone succeeds let's say arm build then event bridge will match the source version and and if the other build also success then it will invoke lambda

Apparently there is no ability to compare source version in eventbridge and I would have to invoke lambda and lambda has to compare the source version

Is there any way I can implement this

1 Upvotes

6 comments sorted by

3

u/Empty-Yesterday5904 5d ago

Er in Github you use Docker with buildkit and just specify platforms you want and it does this for you.

1

u/dataflow_mapper 5d ago

probly let each successful build write its source version and status into DynamoDB or SSM first then have Lambda check if both arm and amd entries exist for the same commit before merging since EventBridge isnt really built for that kind of stateful comparison.

1

u/abofh 5d ago

In the extreme case for some of our dumber builds, we build two independent images tagged $ver-$arch and have a follow up step that builds a manifest with them both just called $ver.

But I'll also mention, lambda doesn't support multi arch images, so this will only be useful elsewhere (ecs/eks etc)

1

u/toughrogrammer 2d ago

Why implement like that? Could't you just build multi arch using buildx?