5 Commits
Author SHA1 Message Date
Nicolas BeckandAllie Sadler 374636ff15 cmd/docker: Add guidance for unavailable cloud plugins
Explain how to install the Offload plugin when --cloud cannot find it,
and link to the cloud flag documentation. Preserve diagnostic details
for invalid or incompatible plugins and limit installation guidance
to Offload.

Use standard default-value handling in the resolution tests to satisfy
the lint complexity limit without changing test coverage.

Co-authored-by: Allie Sadler <102604716+aevesdocker@users.noreply.github.com>
Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
2026-10-07 16:48:27 +00:00
Nick Sieger 8503a98b68 refactor(cmd/docker): split resolveCloudContext to satisfy gocyclo
- extract setResolverStdio for resolver terminal wiring
- extract validateResolvedContext for context/endpoint checks

Signed-off-by: Nick Sieger <nick@nicksieger.com>
2026-10-05 15:29:43 -05:00
Nicolas Beck 488292ca1f cmd/docker: Allow interactive cloud context resolution
Forward stdin and stderr to cloud context providers when both are
terminals, allowing prompts during --cloud resolution. Pass file handles
directly to preserve terminal detection and leave piped or redirected
input available to the requested command.

Use the standard console handles when Windows terminal wrappers hide
their underlying files. Keep stdout reserved for the JSON response.

Signed-off-by: Nicolas Beck <nicolas.beck@docker.com>
2026-10-05 19:59:25 +00:00
Nick Sieger 6cb63efe6f fix(cli): recognize build/bake/builder aliasing before cloud help check
docker --cloud build rejected every BuildKit-only flag (--secret, --ssh,
--push, --output, ...) because cloudHelpRequest parsed remaining args
against the legacy build command's flag set before processAliases
rewrites build into a buildx invocation. Treat build/bake/builder/image
build the same as plugin commands: only recognize --help/-h immediately
after the resolved command path instead of validating flags.

Fixes #7350

Signed-off-by: Nick Sieger <nick@nicksieger.com>
2026-10-02 16:52:51 -05:00
Paweł Gronowski fb1cc07c08 cmd/docker: Add --cloud with configurable context resolution
Resolve it through the offload plugin by default, with a provider
override in features.cloud in the Docker config.

Require the selected plugin to declare the cloud-context-resolver
feature in its metadata before showing the flag in help and completion
or invoking its __resolve-context operation.

Resolve through WithContextResolver, after the config file and context
store are loaded but before client initialization, without wrapping or
re-executing Docker.

Forward --context to downstream plugins so they need not support
--cloud or repeat provisioning. Skip provisioning for help, version,
and completion requests. Report unknown flags and missing flag values
before provisioning, so a mistyped invocation fails without creating
cloud resources or contacting the engine selected before resolution.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2026-10-01 20:17:44 +02:00