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