diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2021-09-14 11:52:51 -0400 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2021-09-16 11:00:05 -0400 |
commit | e07dccc3ad33c9018466b40056de5f002cd11271 (patch) | |
tree | d67868d65e6924c88e45b8169fcf06f098e483a8 /pkg/bindings/images/build.go | |
parent | c7c4cb886700823ba0f014e57e93faf450ac1241 (diff) | |
download | podman-e07dccc3ad33c9018466b40056de5f002cd11271.tar.gz podman-e07dccc3ad33c9018466b40056de5f002cd11271.tar.bz2 podman-e07dccc3ad33c9018466b40056de5f002cd11271.zip |
build: take advantage of --platform lists
The builder can take a list of platforms in the Platforms field of its
BuildOptions argument, and we should definitely take advantage of that.
The `bud-multiple-platform-values` test from buildah exercises support
for this, so
[NO TESTS NEEDED]
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Diffstat (limited to 'pkg/bindings/images/build.go')
-rw-r--r-- | pkg/bindings/images/build.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/bindings/images/build.go b/pkg/bindings/images/build.go index 3beafa585..9d5aad23b 100644 --- a/pkg/bindings/images/build.go +++ b/pkg/bindings/images/build.go @@ -220,6 +220,16 @@ func Build(ctx context.Context, containerFiles []string, options entities.BuildO if len(platform) > 0 { params.Set("platform", platform) } + if len(options.Platforms) > 0 { + params.Del("platform") + for _, platformSpec := range options.Platforms { + platform = platformSpec.OS + "/" + platformSpec.Arch + if platformSpec.Variant != "" { + platform += "/" + platformSpec.Variant + } + params.Add("platform", platform) + } + } params.Set("pullpolicy", options.PullPolicy.String()) |