aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/pkg/cli
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-08-28 09:39:47 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-29 14:27:11 +0000
commiteb5fdebc84e59f8645218f8fdfd6e6a8136cfa43 (patch)
treeb1625395d2cb3ca26ba85c3e418ce36edcea27af /vendor/github.com/projectatomic/buildah/pkg/cli
parent6a46af571e70fd49655fe97df93391500933b2d1 (diff)
downloadpodman-eb5fdebc84e59f8645218f8fdfd6e6a8136cfa43.tar.gz
podman-eb5fdebc84e59f8645218f8fdfd6e6a8136cfa43.tar.bz2
podman-eb5fdebc84e59f8645218f8fdfd6e6a8136cfa43.zip
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 <dwalsh@redhat.com> Closes: #1364 Approved by: mheon
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pkg/cli')
-rw-r--r--vendor/github.com/projectatomic/buildah/pkg/cli/common.go32
1 files changed, 26 insertions, 6 deletions
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
+}