From eb5fdebc84e59f8645218f8fdfd6e6a8136cfa43 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 28 Aug 2018 09:39:47 -0400 Subject: Vendor in latest projectatomic/buildah This will help document the defaults in podman build. podman build --help will now show the defaults and mention the environment variables that can be set to change them. Signed-off-by: Daniel J Walsh Closes: #1364 Approved by: mheon --- .../projectatomic/buildah/pkg/cli/common.go | 32 ++++++++++++++++++---- 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'vendor/github.com/projectatomic/buildah/pkg/cli') diff --git a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go index 39a1773e4..0d035f471 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go +++ b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go @@ -10,12 +10,12 @@ import ( "strings" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/projectatomic/buildah" "github.com/projectatomic/buildah/util" "github.com/urfave/cli" ) var ( - runtime = util.Runtime() usernsFlags = []cli.Flag{ cli.StringFlag{ Name: "userns", @@ -113,7 +113,8 @@ var ( }, cli.StringFlag{ Name: "format", - Usage: "`format` of the built image's manifest and metadata", + Usage: "`format` of the built image's manifest and metadata. Use BUILDAH_FORMAT environment variable to override.", + Value: DefaultFormat(), }, cli.StringFlag{ Name: "iidfile", @@ -121,7 +122,8 @@ var ( }, cli.StringFlag{ Name: "isolation", - Usage: "`type` of process isolation to use", + Usage: "`type` of process isolation to use. Use BUILDAH_ISOLATION environment variable to override.", + Value: DefaultIsolation(), }, cli.StringSliceFlag{ Name: "label", @@ -129,7 +131,7 @@ var ( }, cli.BoolFlag{ Name: "layers", - Usage: fmt.Sprintf("cache intermediate layers during build (default %t)", UseLayers()), + Usage: fmt.Sprintf("cache intermediate layers during build. Use BUILDAH_LAYERS environment variable to override. (default %t)", UseLayers()), }, cli.BoolFlag{ Name: "no-cache", @@ -161,8 +163,8 @@ var ( }, cli.StringFlag{ Name: "runtime", - Usage: "`path` to an alternate runtime", - Value: runtime, + Usage: "`path` to an alternate runtime. Use BUILDAH_RUNTIME environment variable to override.", + Value: util.Runtime(), }, cli.StringSliceFlag{ Name: "runtime-flag", @@ -260,3 +262,21 @@ func UseLayers() bool { } return false } + +// DefaultFormat returns the default image format +func DefaultFormat() string { + format := os.Getenv("BUILDAH_FORMAT") + if format != "" { + return format + } + return buildah.OCI +} + +// DefaultIsolation returns the default image format +func DefaultIsolation() string { + isolation := os.Getenv("BUILDAH_ISOLATION") + if isolation != "" { + return isolation + } + return buildah.OCI +} -- cgit v1.2.3-54-g00ecf