From eb8057e8e0dceddbf3c9bf74b2a21b07ed322bfd Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 20 Jan 2022 09:50:33 -0800 Subject: [PATCH] forbid setting no-cache and no-cache-filter together Per review request. Signed-off-by: Tonis Tiigi --- commands/build.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/build.go b/commands/build.go index 97c18799..2ebca306 100644 --- a/commands/build.go +++ b/commands/build.go @@ -99,6 +99,10 @@ func runBuild(dockerCli command.Cli, in buildOptions) (err error) { pull = *in.pull } + if noCache && len(in.noCacheFilter) > 0 { + return errors.Errorf("--no-cache and --no-cache-filter cannot currently be used together") + } + if in.quiet && in.progress != "auto" && in.progress != "quiet" { return errors.Errorf("progress=%s and quiet cannot be used together", in.progress) } else if in.quiet {