diff --git a/cmd/buildah/bud.go b/cmd/buildah/bud.go index fe5c8a36..ce0df5ea 100644 --- a/cmd/buildah/bud.go +++ b/cmd/buildah/bud.go @@ -8,6 +8,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/containers/storage/pkg/archive" + "github.com/projectatomic/buildah" "github.com/projectatomic/buildah/imagebuildah" "github.com/urfave/cli" ) @@ -39,6 +40,15 @@ var ( Name: "build-arg", Usage: "`argument=value` to supply to the builder", }, + cli.StringFlag{ + Name: "runtime", + Usage: "`path` to an alternate runtime", + Value: buildah.DefaultRuntime, + }, + cli.StringSliceFlag{ + Name: "runtime-flag", + Usage: "add global flags for the container runtime", + }, cli.StringFlag{ Name: "tag, t", Usage: "`tag` to apply to the built image", @@ -77,6 +87,14 @@ func budCmd(c *cli.Context) error { if c.IsSet("pull-always") { pull = c.Bool("pull-always") } + runtimeFlags := []string{} + if c.IsSet("runtime-flag") { + runtimeFlags = c.StringSlice("runtime-flag") + } + runtime := "" + if c.IsSet("runtime") { + runtime = c.String("runtime") + } pullPolicy := imagebuildah.PullNever if pull { @@ -178,6 +196,8 @@ func budCmd(c *cli.Context) error { SignaturePolicyPath: signaturePolicy, Args: args, Output: output, + Runtime: runtime, + RuntimeArgs: runtimeFlags, } return imagebuildah.BuildDockerfiles(store, options, dockerfiles...) diff --git a/docs/buildah-bud.md b/docs/buildah-bud.md index bed7f1fc..12901c2c 100644 --- a/docs/buildah-bud.md +++ b/docs/buildah-bud.md @@ -55,8 +55,8 @@ resulting image's configuration. **--runtime** *path* -The *path* to an alternate runtime, which will be used to run commands -specified by the **RUN** instruction. +The *path* to an alternate OCI-compatible runtime, which will be used to run +commands specified by the **RUN** instruction. **--runtime-flag** *flag* diff --git a/docs/buildah-run.md b/docs/buildah-run.md index 82cdf7f2..88270cc8 100644 --- a/docs/buildah-run.md +++ b/docs/buildah-run.md @@ -16,7 +16,7 @@ the *buildah config* command. **--runtime** *path* -The *path* to an alternate runtime. +The *path* to an alternate OCI-compatible runtime. **--runtime-flag** *flag*