forked from Ivasoft/drone-docker
Add support for docker --platform flag
Add a --platform flag so that the user can specify a value for the corresponding flag passed to docker. This is useful in the context of multi-arch builds and buildkit (DOCKER_BUILDKIT=1 in the environment). Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
This commit is contained in:
committed by
TP Honey
parent
0d40d7fa5a
commit
5a691ae1e4
@@ -63,6 +63,7 @@ type (
|
||||
SecretFiles []string // Docker build secrets with file as source
|
||||
AddHost []string // Docker build add-host
|
||||
Quiet bool // Docker build quiet
|
||||
Platform string // Docker build platform
|
||||
}
|
||||
|
||||
// Plugin defines the Docker plugin parameters.
|
||||
@@ -324,6 +325,9 @@ func commandBuild(build Build) *exec.Cmd {
|
||||
if build.Quiet {
|
||||
args = append(args, "--quiet")
|
||||
}
|
||||
if build.Platform != "" {
|
||||
args = append(args, "--platform", build.Platform)
|
||||
}
|
||||
|
||||
if build.AutoLabel {
|
||||
labelSchema := []string{
|
||||
|
||||
Reference in New Issue
Block a user