Skip to content

Add Wslc client support#382

Draft
patverb wants to merge 1 commit into
mainfrom
patverb/wslc
Draft

Add Wslc client support#382
patverb wants to merge 1 commit into
mainfrom
patverb/wslc

Conversation

@patverb

@patverb patverb commented Jul 16, 2026

Copy link
Copy Markdown

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

Copilot AI review requested due to automatic review settings July 16, 2026 15:48
@patverb
patverb requested a review from a team as a code owner July 16, 2026 15:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WslcClient plus wslc-specific list/inspect record schemas and normalizers.
  • Updated integration tests to optionally run against wslc and skip unsupported behaviors (--expose, restart, events).
  • Refactored DockerClientBase to allow overriding mount arg emission for run, and fixed exec to 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
bwateratmsft marked this pull request as draft July 16, 2026 20:02
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.

2 participants