Skip to content

Support local container development on Windows#14566

Open
Badbird5907 wants to merge 2 commits into
cloudflare:mainfrom
Badbird5907:windows-local-container-dev
Open

Support local container development on Windows#14566
Badbird5907 wants to merge 2 commits into
cloudflare:mainfrom
Badbird5907:windows-local-container-dev

Conversation

@Badbird5907

@Badbird5907 Badbird5907 commented Jul 5, 2026

Copy link
Copy Markdown

Describe your change...

This PR adds support for local container development on Windows by routing the container egress listener to loopback, matching the existing macOS behavior (related workerd change: cloudflare/workerd#6859)

The Workers runtime connects to the container engine via kj::Network::parseAddress, which on Windows can only resolve TCP addresses (no named-pipe support). Docker Desktop on Windows listens on a named pipe (\\.\pipe\docker_engine), so this PR proxies the named pipe to a loopback TCP address and hands the runtime that address instead.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
      • Manually tested on Windows 11 + Docker Desktop with a worker that runs a container (DO + Dockerfile)
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: the docs do not mention supported platforms for local dev here

I didn't start a discussion first: I needed local container dev to work on native Windows (rather than requiring WSL), so I forked & implemented it and decided to open a PR in case it's useful.
Parts of this PR was written with AI; happy to iterate on the implementation.


Open in Devin Review

@changeset-bot

changeset-bot Bot commented Jul 5, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f9dd2c9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
wrangler Minor
@cloudflare/vite-plugin Minor
miniflare Minor
@cloudflare/vitest-pool-workers Patch
@cloudflare/deploy-helpers Patch
@cloudflare/pages-shared Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@workers-devprod workers-devprod requested review from a team and petebacondarwin and removed request for a team July 5, 2026 21:37
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/cloudchamber
  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/windows-local-containers.md: [@cloudflare/wrangler]
  • packages/containers-shared/index.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/containers-shared/src/docker-proxy.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/containers-shared/src/images.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/containers-shared/src/utils.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/containers-shared/tests/docker-proxy.test.ts: [@cloudflare/cloudchamber @cloudflare/wrangler]
  • packages/miniflare/src/index.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/plugins/core/index.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/plugins/shared/index.ts: [@cloudflare/wrangler]

devin-ai-integration[bot]

This comment was marked as resolved.

wrangler dev, the Vite plugin, and getPlatformProxy previously errored on
Windows and required WSL for containers. The Workers runtime can't connect to
the Windows Docker named pipe directly, so Miniflare now bridges it to a
loopback TCP proxy (containers-shared/docker-proxy) for the runtime while the
Docker CLI keeps using the pipe. Removes the hard win32 guard and wires the
resolved engine address through Miniflare's container-engine setup, disposing
the proxy with the instance.
@Badbird5907 Badbird5907 force-pushed the windows-local-container-dev branch from 7099f3b to 461adc3 Compare July 5, 2026 22:25
@petebacondarwin petebacondarwin added blocked Blocked on other work product:containers Relating to Cloudflare Containers: https://developers.cloudflare.com/containers/ labels Jul 6, 2026
@petebacondarwin petebacondarwin requested review from emily-shen and removed request for petebacondarwin July 6, 2026 12:36
@petebacondarwin

Copy link
Copy Markdown
Contributor

Marking this as blocked on the workerd PR being merged and released.

@petebacondarwin

Copy link
Copy Markdown
Contributor

Assigned to @emily-shen since, while it looks fine to me, I'd like her eyes on this too.

@pkg-pr-new

pkg-pr-new Bot commented Jul 6, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14566

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14566

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14566

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14566

miniflare

npm i https://pkg.pr.new/miniflare@14566

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14566

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14566

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14566

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14566

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14566

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14566

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14566

wrangler

npm i https://pkg.pr.new/wrangler@14566

commit: f9dd2c9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked on other work product:containers Relating to Cloudflare Containers: https://developers.cloudflare.com/containers/

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

3 participants