wslcontainers
Ask AI wslc 2.9.4.0

Compose volumes on wslc

Updated 2026-07-27 · 4 min read · wslc public preview

Compose's volumes is partially supported by wslc 2.9.4.0. It maps onto -v, but not every form of the Compose key survives the translation, so the shape of your YAML decides whether it works unchanged or needs a preparatory step first.

Compose keyvolumes
Status on wslc 2.9.4.0Partially supported
wslc mapping -v
Verified againstwslc 2.9.4.0, windows-2025 runner

Measured caveat. Named volumes must be created first with wslc volume create. Windows paths go over VirtioFS.

The Compose input

A minimal service that uses volumes. Everything below is derived from this snippet, so you can match it against the shape of your own file.

volumes:
  pgdata:
services:
  db:
    image: postgres:16-alpine
    volumes:
      - pgdata:/var/lib/postgresql/data
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro

The wslc translation

wslc has no Compose runtime, so there is no file to hand it. The service becomes a wslc run invocation and volumes becomes -v:

wslc volume create proj_pgdata
wslc run --name proj-db \
  -v proj_pgdata:/var/lib/postgresql/data \
  -v C:/src/app/init.sql:/docker-entrypoint-initdb.d/init.sql:ro postgres:16-alpine

Container and network names are prefixed with a project name the way Compose would do it, because wslc keeps no notion of a project. Pick a prefix and apply it consistently or the second stack you start will collide with the first.

How we know

The mapping was confirmed by executing it against wslc 2.9.4.0 on a Windows Server 2025 runner, not inferred from --help output alone. That distinction matters on a preview runtime: several flags are accepted by the parser but behave differently from their Docker namesakes, and only running them surfaces the difference.

Claims on this site are re-checked by a scheduled workflow that runs the commands again on a fresh Windows Server 2025 runner and fails when a documented behaviour stops matching reality. wslc ships roughly every two weeks during the preview, so treat any page that disagrees with your own machine as the page being stale, and check the version you are on with wslc version.

Where this key sits in the wider picture

Of the 39 Compose keys we audited against wslc 2.9.4.0, 23 translate directly, 2 translate with a caveat, and 14 have no equivalent at all. That ratio is the honest answer to whether a Compose stack can move to wslc today: simple single-service definitions usually port cleanly, while anything relying on orchestration, capabilities or restart behaviour does not.

Microsoft is tracking native Compose support in issue 40948, opened by a WSL program manager. At the time of writing it carried no milestone, no assignee and no implementation pull request, and the strongest community proposal is to expose a Docker Engine API-compatible endpoint and bundle upstream Compose rather than reimplement it. Either route would change this page from a migration guide into a behaviour-difference reference, which is why the URL will not move.

Full mapping table: Docker Compose to wslc migration guide. Command-level equivalents: Docker to wslc cheat sheet. Paste a whole file into the Compose migration analyser to see every key in it classified at once.

Related guides