Skip to main content

docker2wslc

Translate Docker commands, Compose files and dev container configs to wslc — the native Linux container runtime built into the Windows Subsystem for Linux, which runs containers on Windows 11 without Docker Desktop.

No network calls, no daemon, no telemetry. Pure rule-driven translation.

pip install docker2wslc          # translation only
pip install 'docker2wslc[yaml]'  # + Compose analysis

Convert a command

$ docker2wslc convert docker run --gpus all --restart always -p 8080:80 nginx
wslc run --gpus all -p 8080:80 nginx

Migration notes
  WARN  Restart policies are not implemented in the wslc preview. Flag dropped — use a
        Windows scheduled task or a wrapper script for auto-restart.
  INFO  `--gpus` is native in wslc 2.9.4, but the host must actually have the GPU: on a
        machine without one, `--gpus all` fails at container init with an ldconfig error.

Commands come from arguments, a file, or stdin:

docker2wslc convert docker ps -a
docker2wslc convert --file deploy.sh
cat deploy.sh | docker2wslc convert

Analyse a Compose file

wslc has no Compose runtime. This turns each service into an equivalent wslc run and tells you exactly what cannot be carried over:

$ docker2wslc compose docker-compose.yml
# wslc has no Compose runtime. Equivalent commands:

wslc volume create pgdata
wslc network create backend
# start order matters: web -> db

# service: web
wslc run -d --name web -e NGINX_HOST=localhost -p 8080:80 --network backend nginx:alpine
  ! networks: Bridge-only. Create with wslc network create before running.
  x depends_on: No dependency ordering. Start services in order yourself and add readiness waits.
  x restart: No restart policies in the wslc preview.

# service: db
wslc run -d --name db -v pgdata:/var/lib/postgresql/data --network backend --health-cmd 'pg_isready -U postgres' --health-interval 10s --health-retries 5 postgres:16-alpine
  ! volumes: Named volumes must be created first with wslc volume create. Windows paths go over VirtioFS.
  ! networks: Bridge-only. Create with wslc network create before running.

Lint a repository

Scans for docker-compose.y*ml, compose.y*ml and devcontainer.json:

docker2wslc lint .

Use in CI

Exit codes are meaningful, so this works as a gate:

Code Meaning
0 Fully compatible
1 Degraded — flags dropped or rewritten, still runnable
2 Unmigratable — Compose, Swarm, buildx, or a parse failure
- run: pip install 'docker2wslc[yaml]'
- run: docker2wslc lint .        # fails the job on exit 2

Python API

from docker2wslc import translate, analyse

result = translate("docker run --platform linux/amd64 -it ubuntu bash")
print(result.output)      # wslc run -it ubuntu bash
print(result.exit_code)   # 1
for note in result.notes:
    print(note.severity, note.text)

report = analyse(open("docker-compose.yml").read())
print(report.as_dict())

--json on any subcommand gives the same structure for shell pipelines.

What wslc cannot do

Worth knowing before you migrate. These are runtime limitations, not gaps in this tool:

  • No Compose runtime — translate services by hand, see the migration guide
  • No restart policies — use a scheduled task
  • No --platform — host architecture only
  • No depends_on gating — health flags work (--health-cmd et al), but nothing waits on health state for you
  • No Docker socket or Engine API — Testcontainers, Portainer and act cannot attach
  • No buildx / bake — single-platform wslc build only
  • GPU — --gpus all, the same flag as Docker. It is --device that wslc lacks.

CLI-driven tooling ports to wslc. API-driven tooling does not. That single distinction explains most migration surprises — including why VS Code Dev Containers does work once you set dev.containers.dockerPath to wslc.

Docs

Accuracy

Rules target the 2026-07 wslc public preview and live in a single rules.json shared by the Python package, the npm CLI, the MCP server and the VS Code extension. wslc is a moving target; if you hit a mapping that is wrong, open an issue with the command and the actual wslc output.

MIT licensed.

Metadata

Release files for docker2wslc 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for docker2wslc 0.2.0
File Size Uploaded Provenance Actions
docker2wslc-0.2.0.tar.gz 16.6 kB Without provenance Details for docker2wslc-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for docker2wslc 0.2.0
File Interpreter ABI Platform Actions
docker2wslc-0.2.0-py3-none-any.whl Python 3 none any Details for docker2wslc-0.2.0-py3-none-any.whl

Total release size: 36.2 kB

Release files / docker2wslc-0.2.0.tar.gz

Download URL docker2wslc-0.2.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6124f254471d89bc7a5832792153045448c4d4f21aa7e4f6eefb4d180e29726d
BLAKE2b-256 checksum
How to use checksums
5a711e4bbe73a268b28c8a916e16b3a9a2977ec3b0d8d3c705676570824cd7a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Release files / docker2wslc-0.2.0-py3-none-any.whl

Download URL docker2wslc-0.2.0-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8fb7e372b90a209879e073042a69fcec6aeaa8abacfb8463b0b4e8c3c1499ca3
BLAKE2b-256 checksum
How to use checksums
46eaae908d65964d9ffcdc82cb6b402d720c1dc9d4ba9ba44c7da461827a63cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.15

Security for docker2wslc 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page