From 8ef9bd41d7bf1363bc2065cbf2b5fac8c7034f8b Mon Sep 17 00:00:00 2001 From: Evan <50347938+Badbird5907@users.noreply.github.com> Date: Sun, 5 Jul 2026 12:39:39 -0400 Subject: [PATCH] Route container host-gateway to loopback on Windows The container egress listener binds to the address returned by gatewayForPlatform. On macOS it returns none (falls back to loopback) because Docker Desktop routes the host-gateway through a VM; every other platform got the Docker bridge gateway IP. On Windows the bridge IP is not a local interface on the host, so the bind fails and container start() aborts. Windows Docker Desktop behaves like macOS, so include _WIN32 in the loopback branch. --- src/workerd/server/container-client.c++ | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/workerd/server/container-client.c++ b/src/workerd/server/container-client.c++ index a906bbec90f..81f6af1bea1 100644 --- a/src/workerd/server/container-client.c++ +++ b/src/workerd/server/container-client.c++ @@ -874,9 +874,10 @@ kj::Promise warnAboutStaleSnapshotVolumes(kj::Network& network, kj::String } // Returns the gateway IP on Linux for direct container access. -// Returns kj::none on macOS where Docker Desktop routes host-gateway to host loopback. +// Returns kj::none on macOS and Windows where Docker Desktop routes host-gateway to host loopback +// through the VM (so the bridge gateway IP is not a local interface on the host). kj::Maybe gatewayForPlatform(kj::String gateway) { -#ifdef __APPLE__ +#if defined(__APPLE__) || defined(_WIN32) return kj::none; #else return kj::mv(gateway);