Skip to content

Support container CLI argument prefixes - #1291

Open
Gordon Lam (yeelam-gordon) wants to merge 2 commits into
devcontainers:mainfrom
yeelam-gordon:copilot/wslc-session-context
Open

Support container CLI argument prefixes#1291
Gordon Lam (yeelam-gordon) wants to merge 2 commits into
devcontainers:mainfrom
yeelam-gordon:copilot/wslc-session-context

Conversation

@yeelam-gordon

Copy link
Copy Markdown

Motivation

Dev Containers can substitute a Docker-compatible executable such as wslc, but app-owned WSLC Sessions require --session <name> before ordinary Docker-shaped commands. The CLI therefore needs a small transport mechanism for placing provider-specific arguments immediately after the configured Docker executable.

Minimal design

  • Add one hidden internal --docker-path-args option containing a JSON string array.
  • Do not add devcontainer.json schema or public configuration surface.
  • Keep the optional field inert when absent.
  • Centralize prefix insertion across non-PTY and PTY execution.
  • Leave ordinary Docker and Podman behavior unchanged.
  • Leave standalone Compose unchanged.
  • Preserve the prefix for V2 Compose and variant/version probes.

Why not environment variables

A provider may not expose an environment-variable mechanism, while explicit argv is auditable at process boundaries and keeps the transport contract visible to the embedding caller.

Scope

This change defines only a CLI transport contract. It contains no WSLC-specific behavior or UI.

Tests run

  • npm run type-check
  • Focused dockerUtils tests covering prefix ordering, Compose, and parsing
  • npm run lint
  • compile-prod

Design considerations and risks

The option is hidden and internal rather than a public compatibility promise. Parsing is strict so malformed input fails explicitly. Upstream consumers must package a matching CLI revision before relying on the argument contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8539f306-93c4-4831-9bcd-ec77196d5ec8
@yeelam-gordon
Gordon Lam (yeelam-gordon) requested a review from a team as a code owner August 27, 2026 14:29
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8539f306-93c4-4831-9bcd-ec77196d5ec8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant