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
@@ -269,6 +269,11 @@ func main() {
|
||||
Usage: "card path location to write to",
|
||||
EnvVar: "DRONE_CARD_PATH",
|
||||
},
|
||||
cli.StringFlag{
|
||||
Name: "platform",
|
||||
Usage: "platform value to pass to docker",
|
||||
EnvVar: "PLUGIN_PLATFORM",
|
||||
},
|
||||
}
|
||||
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
@@ -312,6 +317,7 @@ func run(c *cli.Context) error {
|
||||
SecretFiles: c.StringSlice("secrets-from-file"),
|
||||
AddHost: c.StringSlice("add-host"),
|
||||
Quiet: c.Bool("quiet"),
|
||||
Platform: c.String("platform"),
|
||||
},
|
||||
Daemon: docker.Daemon{
|
||||
Registry: c.String("docker.registry"),
|
||||
|
||||
Reference in New Issue
Block a user