diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-06-07 01:00:07 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-13 12:49:32 +0000 |
commit | be217caa3856c76a6b997c203422715e13b0335a (patch) | |
tree | 49190e0813ba860ccc74d017ccf12562e009c6bc /vendor/github.com/projectatomic/buildah/pkg | |
parent | 95ea3d4f3a77d014fdd1be43411ba96a85091712 (diff) | |
download | podman-be217caa3856c76a6b997c203422715e13b0335a.tar.gz podman-be217caa3856c76a6b997c203422715e13b0335a.tar.bz2 podman-be217caa3856c76a6b997c203422715e13b0335a.zip |
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 <dwalsh@redhat.com>
Closes: #938
Approved by: umohnani8
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pkg')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/pkg/cli/common.go | 20 |
1 files changed, 19 insertions, 1 deletions
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" @@ -120,8 +124,12 @@ var ( 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 +} |