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
This commit is contained in:
Daniel J Walsh
2018-06-07 01:00:07 -04:00
committed by Atomic Bot
parent 95ea3d4f3a
commit be217caa38
14 changed files with 524 additions and 42 deletions

View File

@@ -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
}