diff options
author | baude <bbaude@redhat.com> | 2018-09-06 16:10:06 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-07 12:57:09 +0000 |
commit | d92650a922fa82852d6f3310eff24e6b8a93fb03 (patch) | |
tree | a4430220fe8529b7cfd29685c36472616b48db54 /vendor/github.com/projectatomic/buildah/pkg/cli | |
parent | 782caea8015679e5d67d15b9562488da06cdfcd5 (diff) | |
download | podman-d92650a922fa82852d6f3310eff24e6b8a93fb03.tar.gz podman-d92650a922fa82852d6f3310eff24e6b8a93fb03.tar.bz2 podman-d92650a922fa82852d6f3310eff24e6b8a93fb03.zip |
use layer cache when building images
to more closely mimic docker default behavior, the --layers
cli option is set to true by default for podman. the buildah
environment variable of BUILDAH_LAYERS is still honored and will
override the command line input.
this should be considered in place of PR #1383.
Many thanks for Scott McCarty for inspiring this welcome change.
Signed-off-by: baude <bbaude@redhat.com>
Closes: #1422
Approved by: rhatdan
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/pkg/cli')
-rw-r--r-- | vendor/github.com/projectatomic/buildah/pkg/cli/common.go | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go index 0d035f471..a438daf6a 100644 --- a/vendor/github.com/projectatomic/buildah/pkg/cli/common.go +++ b/vendor/github.com/projectatomic/buildah/pkg/cli/common.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/opencontainers/runtime-spec/specs-go" + "github.com/pkg/errors" "github.com/projectatomic/buildah" "github.com/projectatomic/buildah/util" "github.com/urfave/cli" @@ -68,6 +69,13 @@ var ( }, } + LayerFlags = []cli.Flag{ + cli.BoolFlag{ + Name: "layers", + Usage: fmt.Sprintf("cache intermediate layers during build. Use BUILDAH_LAYERS environment variable to override. (default %t)", UseLayers()), + }, + } + BudFlags = []cli.Flag{ cli.StringSliceFlag{ Name: "annotation", @@ -130,10 +138,6 @@ var ( Usage: "Set metadata for an image (default [])", }, cli.BoolFlag{ - Name: "layers", - Usage: fmt.Sprintf("cache intermediate layers during build. Use BUILDAH_LAYERS environment variable to override. (default %t)", UseLayers()), - }, - cli.BoolFlag{ Name: "no-cache", Usage: "Do not use existing cached images for the container build. Build from the start with a new set of cached layers.", }, @@ -280,3 +284,12 @@ func DefaultIsolation() string { } return buildah.OCI } + +func VerifyFlagsArgsOrder(args []string) error { + for _, arg := range args { + if strings.HasPrefix(arg, "-") { + return errors.Errorf("No options (%s) can be specified after the image or container name", arg) + } + } + return nil +} |