Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

Commit

Permalink
image-build: add unsupported --squash flag (#52)
Browse files Browse the repository at this point in the history
This enables drop-in replacability for `docker image build --squash`
with a warning that squash is not supported.

Signed-off-by: Jacob Blain Christen <jacob@rancher.com>
  • Loading branch information
dweomer committed May 25, 2021
1 parent 5d4c2a0 commit 4d4bd30
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/client/image/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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|<id>[=<socket>|<key>[,<key>]]" 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 {
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 4d4bd30

Please sign in to comment.