fix: allow multi-platform builds using --push flag (#29)

This commit is contained in:
Robert Kaussow
2021-06-16 22:21:00 +02:00
committed by GitHub
parent 562ee26fda
commit a6cc96fbda
2 changed files with 10 additions and 1 deletions

View File

@@ -65,7 +65,6 @@ func commandBuild(build Build) *exec.Cmd {
args := []string{
"buildx",
"build",
"--load",
"--rm=true",
"-f", build.Dockerfile,
"-t", build.Name,
@@ -107,6 +106,12 @@ func commandBuild(build Build) *exec.Cmd {
args = append(args, "--quiet")
}
if len(build.Platforms.Value()) > 1 {
args = append(args, "--push")
} else {
args = append(args, "--load")
}
if len(build.Platforms.Value()) > 0 {
args = append(args, "--platform", strings.Join(build.Platforms.Value()[:], ","))
}