Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: disable and hide --output for podman-remote clients #14125

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cmd/podman/images/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ func buildFlags(cmd *cobra.Command) {
_ = flags.MarkHidden("tls-verify")
_ = flags.MarkHidden("compress")
_ = flags.MarkHidden("volume")
_ = flags.MarkHidden("output")
}
}

Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion docs/source/markdown/podman-build.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ Windows base images, so using this option is usually unnecessary.

Output destination (format: type=local,dest=path)

The --output (or -o) option extends the default behavior of building a container image by allowing users to export the contents of the image as files on the local filesystem, which can be useful for generating local binaries, code generation, etc.
The --output (or -o) option extends the default behavior of building a container image by allowing users to export the contents of the image as files on the local filesystem, which can be useful for generating local binaries, code generation, etc. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
flouthoc marked this conversation as resolved.
Show resolved Hide resolved

The value for --output is a comma-separated sequence of key=value pairs, defining the output type and options.

Expand Down