Add Wslc client support#382
Draft
patverb wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-class support for the Windows Subsystem for Linux Container CLI (wslc) to @microsoft/vscode-container-client by introducing a WslcClient that subclasses DockerClientBase and overrides the command verbs/arg builders/parsers where wslc differs from Docker. Also includes a shared base fix to use the correct exec --detach flag and updates tests/tooling to cover the new runtime.
Changes:
- Added
WslcClientpluswslc-specific list/inspect record schemas and normalizers. - Updated integration tests to optionally run against
wslcand skip unsupported behaviors (--expose,restart,events). - Refactored
DockerClientBaseto allow overriding mount arg emission forrun, and fixedexecto emit--detach.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/vscode-container-client/src/test/WslcClient.test.ts | New unit tests covering WslcClient command args, parsing, and unsupported-command behavior. |
| packages/vscode-container-client/src/test/ContainersClientE2E.test.ts | Adds wslc as an integration-test runtime and conditionally skips unsupported features. |
| packages/vscode-container-client/src/index.ts | Exports WslcClient from the package entrypoint. |
| packages/vscode-container-client/src/clients/WslcClient/WslcNetworkRecord.ts | Zod schema + normalizers for wslc network list/inspect payloads. |
| packages/vscode-container-client/src/clients/WslcClient/WslcListVolumeRecord.ts | Zod schema + normalizer for wslc volume list output. |
| packages/vscode-container-client/src/clients/WslcClient/WslcListImageRecord.ts | Zod schema for wslc images output. |
| packages/vscode-container-client/src/clients/WslcClient/WslcListContainerRecord.ts | Zod schema for wslc list output plus numeric-state mapping. |
| packages/vscode-container-client/src/clients/WslcClient/WslcInspectVolumeRecord.ts | Zod schema + normalizer for wslc inspect --type volume. |
| packages/vscode-container-client/src/clients/WslcClient/WslcInspectImageRecord.ts | Zod schema + normalizer for wslc inspect --type image. |
| packages/vscode-container-client/src/clients/WslcClient/WslcInspectContainerRecord.ts | Zod schema + normalizer for wslc inspect --type container. |
| packages/vscode-container-client/src/clients/WslcClient/WslcClient.ts | Core WslcClient implementation overriding verbs/args/parsers and rejecting unsupported commands. |
| packages/vscode-container-client/src/clients/DockerClientBase/DockerClientBase.ts | Adds overridable mount-arg builder for run and fixes exec to use --detach. |
| packages/vscode-container-client/package.json | Bumps package version to 0.6.0. |
| packages/vscode-container-client/CHANGELOG.md | Adds 0.6.0 changelog entry describing WslcClient and the --detach fix. |
| package-lock.json | Updates lockfile package version for vscode-container-client to 0.6.0. |
| .vscode/launch.json | Adds wslc to the debug-time integration test runtime picker. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+64
to
+84
| const repoDigests = image.RepoDigests ?? []; | ||
| const isLocalImage = !repoDigests.some((digest) => !digest.toLowerCase().startsWith('localhost/')); | ||
|
|
||
| return { | ||
| id: image.Id, | ||
| image: imageNameInfo, | ||
| repoDigests, | ||
| isLocalImage, | ||
| environmentVariables, | ||
| ports, | ||
| volumes, | ||
| labels, | ||
| entrypoint: toArray(image.Config?.Entrypoint ?? []), | ||
| command: toArray(image.Config?.Cmd ?? []), | ||
| currentDirectory: image.Config?.WorkingDir || undefined, | ||
| architecture, | ||
| operatingSystem: os, | ||
| createdAt: dayjs(image.Created).toDate(), | ||
| user: image.Config?.User || undefined, | ||
| raw, | ||
| }; |
Comment on lines
+344
to
+353
| const ports: PortBinding[] = (rawContainer.Ports ?? []).map(p => ({ | ||
| containerPort: p.ContainerPort ?? 0, | ||
| hostIp: p.HostIp || '127.0.0.1', | ||
| hostPort: p.HostPort, | ||
| protocol: p.Protocol?.toLowerCase() === 'tcp' | ||
| ? 'tcp' | ||
| : p.Protocol?.toLowerCase() === 'udp' | ||
| ? 'udp' | ||
| : undefined, | ||
| })); |
Comment on lines
+714
to
+718
| protected override getReadFileCommandArgs(options: ReadFileCommandOptions): CommandLineArgs { | ||
| const containerPath = options.path.replace(/\/+$/, ''); | ||
| const lastSlash = containerPath.lastIndexOf('/'); | ||
| const directory = lastSlash <= 0 ? '/' : containerPath.slice(0, lastSlash); | ||
| const fileName = containerPath.slice(lastSlash + 1); |
bwateratmsft
marked this pull request as draft
July 16, 2026 20:02
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add WslcClient for the Windows Subsystem for Linux Container ( wslc ) CLI
Description
Adds a new WslcClient to @microsoft/vscode-container-client that supports wslc (the Windows Subsystem for Linux Container CLI) as an alternative container runtime. It is Windows-only and subclasses DockerClientBase , overriding only the verbs, arg-builders, and parsers that differ from Docker.
This is the extensibility half of the feature; the consumer changes live in microsoft/vscode-containers#.
What's added
• WslcClient
Key differences from Docker that the client handles
• CLI is Windows-only.
• run uses --volume (not --mount ) and supports --network-alias ; throws CommandNotSupportedError for the unsupported --add-host / --expose / --platform .
• List filters ( label , status , name , ancestor , volume , network ; image dangling / reference ) are emitted
• No info / events / context / restart subcommands — these reject with CommandNotSupportedError ( info synthesizes a Linux InfoItem to keep osType -dependent callers working).
Shared base change
• Bug fix: getExecContainerCommandArgs now emits --detach instead of the misspelled --detached , matching the real Docker/Podman CLI flag (affects all clients).
Part of microsoft/vscode-containers#501