mirror of
https://github.com/drone/drone-kaniko.git
synced 2026-06-04 10:14:54 +08:00
Add support for custom platform (#32)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user