From be217caa3856c76a6b997c203422715e13b0335a Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 7 Jun 2018 01:00:07 -0400 Subject: Vendor in latest buildah code This will add --layers support. Also add missing information in man pages on podman build features. Signed-off-by: Daniel J Walsh Closes: #938 Approved by: umohnani8 --- .../projectatomic/buildah/pkg/cli/common.go | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (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 e545e97d3..d00ebbdc5 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go +++ b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go @@ -5,6 +5,10 @@ package cli // that vendor in this code can use them too. import ( + "fmt" + "os" + "strings" + "github.com/opencontainers/runtime-spec/specs-go" "github.com/projectatomic/buildah" "github.com/projectatomic/buildah/util" @@ -119,9 +123,13 @@ var ( Name: "label", Usage: "Set metadata for an image (default [])", }, + cli.BoolFlag{ + Name: "layers", + Usage: fmt.Sprintf("cache intermediate layers during build (default %t)", UseLayers()), + }, cli.BoolFlag{ Name: "no-cache", - Usage: "Do not use caching for the container build. The build process does not currently support caching so this is a NOOP.", + Usage: "Do not use existing cached images for the container build. Build from the start with a new set of cached layers.", }, cli.StringFlag{ Name: "logfile", @@ -230,3 +238,13 @@ var ( }, }, usernsFlags...), NamespaceFlags...) ) + +// UseLayers returns true if BUILDAH_LAYERS is set to "1" or "true" +// otherwise it returns false +func UseLayers() bool { + layers := os.Getenv("BUILDAH_LAYERS") + if strings.ToLower(layers) == "true" || layers == "1" { + return true + } + return false +} -- cgit v1.2.3-54-g00ecf