From 9e3a5da69d69df223b9f9b8116ad536de3dcb791 Mon Sep 17 00:00:00 2001 From: TomSweeneyRedHat Date: Wed, 7 Feb 2018 19:23:22 -0500 Subject: Add some global options to build Signed-off-by: TomSweeneyRedHat Closes: #312 Approved by: mheon --- cmd/podman/build.go | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/podman/build.go b/cmd/podman/build.go index 6e32a80e9..090232364 100644 --- a/cmd/podman/build.go +++ b/cmd/podman/build.go @@ -80,7 +80,26 @@ var ( func buildCmd(c *cli.Context) error { - budCmdArgs := []string{"bud"} + budCmdArgs := []string{} + + logLevel := c.GlobalString("log-level") + if logLevel == "debug" { + budCmdArgs = append(budCmdArgs, "--debug") + } + if c.GlobalIsSet("root") { + budCmdArgs = append(budCmdArgs, "--root", c.GlobalString("root")) + } + if c.GlobalIsSet("runroot") { + budCmdArgs = append(budCmdArgs, "--runroot", c.GlobalString("runroot")) + } + if c.GlobalIsSet("storage-driver") { + budCmdArgs = append(budCmdArgs, "--storage-driver", c.GlobalString("storage-driver")) + } + for _, storageOpt := range c.GlobalStringSlice("storage-opt") { + budCmdArgs = append(budCmdArgs, "--storage-opt", storageOpt) + } + + budCmdArgs = append(budCmdArgs, "bud") if c.IsSet("authfile") { budCmdArgs = append(budCmdArgs, "--authfile", c.String("authfile")) -- cgit v1.2.3-54-g00ecf