From c38e7e5f6172b5f8728ab03d0d36335aaba53553 Mon Sep 17 00:00:00 2001
From: Aditya R <arajan@redhat.com>
Date: Thu, 5 May 2022 16:16:38 +0530
Subject: build: disable --output for podman-remote clients

Disable `build --output` for remote clients and update docs.

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
---
 cmd/podman/images/build.go | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'cmd/podman')

diff --git a/cmd/podman/images/build.go b/cmd/podman/images/build.go
index 1ceb63684..3ea60e18a 100644
--- a/cmd/podman/images/build.go
+++ b/cmd/podman/images/build.go
@@ -190,6 +190,7 @@ func buildFlags(cmd *cobra.Command) {
 		_ = flags.MarkHidden("tls-verify")
 		_ = flags.MarkHidden("compress")
 		_ = flags.MarkHidden("volume")
+		_ = flags.MarkHidden("output")
 	}
 }
 
@@ -201,6 +202,10 @@ func build(cmd *cobra.Command, args []string) error {
 		return errors.New("cannot specify --squash, --squash-all and --layers options together")
 	}
 
+	if cmd.Flag("output").Changed && registry.IsRemote() {
+		return errors.New("'--output' option is not supported in remote mode")
+	}
+
 	// Extract container files from the CLI (i.e., --file/-f) first.
 	var containerFiles []string
 	for _, f := range buildOpts.File {
-- 
cgit v1.2.3-54-g00ecf