Add support for custom platform (#32)

This commit is contained in:
Shubham Agrawal
2021-12-01 17:10:28 +05:30
committed by GitHub
parent 5e7bcabe6a
commit 59e09c14de
4 changed files with 23 additions and 0 deletions
+5
View File
@@ -30,6 +30,7 @@ type (
DigestFile string // Digest file location
NoPush bool // Set this flag if you only want to build the image, without pushing to a registry
Verbosity string // Log level
Platform string // Allows to build with another default platform than the host, similarly to docker build --platform
}
// Artifact defines content of artifact file
@@ -157,6 +158,10 @@ func (p Plugin) Exec() error {
cmdArgs = append(cmdArgs, fmt.Sprintf("--verbosity=%s", p.Build.Verbosity))
}
if p.Build.Platform != "" {
cmdArgs = append(cmdArgs, fmt.Sprintf("--customPlatform=%s", p.Build.Platform))
}
cmd := exec.Command("/kaniko/executor", cmdArgs...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr