From 4d4bd3068c9520c4a9b77e8744d84628655aae3a Mon Sep 17 00:00:00 2001 From: Jacob Blain Christen Date: Tue, 25 May 2021 12:19:22 -0700 Subject: [PATCH] image-build: add unsupported --squash flag (#52) This enables drop-in replacability for `docker image build --squash` with a warning that squash is not supported. Signed-off-by: Jacob Blain Christen --- pkg/client/image/build.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/client/image/build.go b/pkg/client/image/build.go index bc0ad88..2d84b3f 100644 --- a/pkg/client/image/build.go +++ b/pkg/client/image/build.go @@ -35,6 +35,7 @@ type Build struct { Pull bool `usage:"Always attempt to pull a newer version of the image"` Secret []string `usage:"Secret value exposed to the build. Format id=secretname|src=filepath" split:"false"` Ssh []string `usage:"Allow forwarding SSH agent to the builder. Format default|[=|[,]]" split:"false"` + Squash bool `usage:"Squash newly built layers into a single new layer"` } func (s *Build) Do(ctx context.Context, k8s *client.Interface, path string) error { @@ -133,6 +134,10 @@ func (s *Build) frontendAttrs() map[string]string { if s.Pull { m["image-resolve-mode"] = "pull" } + // --squash + if s.Squash { + logrus.Warn("Squash not currently supported by the buildkit backend") + } return m }