Thanks for that. I now see the logic used to build the multiarch images in imagebuildah and then the logic for building fat manifests right under that loop. Looks like a pretty big lift for my project, so I'll opt to use bud.
When I import bud into my project, it crashes when it tries to execute the first command in the containerfile (entrypoint/add/cmd). Do you have any boilerplate for importing bud similar to 04-include-in-your-build-tool.md for commit?
Thanks again,
/Alex
On Thu, Sep 30, 2021 at 09:33:54PM -0000, aflom@redhat.com wrote:
> I'm importing buildah into an application and I don't see a good way to commit multiarch images with github.com/containers/buildah/commit.go/Commit. I see that define.BuildOpts has a platform that is slice of structs that is used for building multi-arch images. The only architecture selection that i see for Commit, is a SystemContext.ArchitectureChoice, which is a single string.
>
> Do I have to use bud for multi-arch builds or is there a streamlined way to use Commit?
The Commit() method only knows how to commit a single working container
to produce a single image. I don't know of a way to change that that
doesn't require making changes to the API that would in turn require
consumers of the library to be patched when updating, and I'm resistant
to making such changes. (They probably still happen, but I try.)
If the calling application needs to build multiple images, it needs to
manage and iterate through the set of platforms it wants to do that for,
like the imagebuildah package does for its builds.
HTH,
Nalin