diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-12-08 16:26:51 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2020-12-09 08:31:36 -0500 |
commit | 0154f9e9b3d158dce901c9f19261714660a2f27b (patch) | |
tree | 443901e8929a17f10ecc28d801cf8b86cba63cad /cmd | |
parent | 247260081a5cdc4065009bcd1080c987974327e5 (diff) | |
download | podman-0154f9e9b3d158dce901c9f19261714660a2f27b.tar.gz podman-0154f9e9b3d158dce901c9f19261714660a2f27b.tar.bz2 podman-0154f9e9b3d158dce901c9f19261714660a2f27b.zip |
Honor the --layers flag
Currently the --layers flag set by the user is ignored, and only the BUILDAH_LAYERS
environment variable being set is observed.
Fixes: https://github.com/containers/podman/issues/8643
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/images/build.go | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go index 739e1c265..beb994f10 100644 --- a/cmd/podman/images/build.go +++ b/cmd/podman/images/build.go @@ -115,6 +115,7 @@ func buildFlags(cmd *cobra.Command) { // --layers flag flag = layerFlags.Lookup("layers") useLayersVal := useLayers() + buildOpts.Layers = useLayersVal == "true" if err := flag.Value.Set(useLayersVal); err != nil { logrus.Errorf("unable to set --layers to %v: %v", useLayersVal, err) } @@ -274,11 +275,7 @@ func buildFlagsWrapperToOptions(c *cobra.Command, contextDir string, flags *buil } } } - // Check to see if the BUILDAH_LAYERS environment variable is set and - // override command-line. - if _, ok := os.LookupEnv("BUILDAH_LAYERS"); ok { - flags.Layers = true - } + flags.Layers = buildOpts.Layers // `buildah bud --layers=false` acts like `docker build --squash` does. // That is all of the new layers created during the build process are |