compose/internal/desktop
Domantas Petrauskas 0afb4c8c4c
Some checks failed
ci / validate (lint) (push) Has been cancelled
ci / validate (validate-docs) (push) Has been cancelled
ci / validate (validate-go-mod) (push) Has been cancelled
ci / validate (validate-headers) (push) Has been cancelled
ci / binary (push) Has been cancelled
ci / bin-image-test (push) Has been cancelled
ci / test (push) Has been cancelled
ci / e2e (plugin, oldstable) (push) Has been cancelled
ci / e2e (standalone, oldstable) (push) Has been cancelled
ci / e2e (plugin, stable) (push) Has been cancelled
ci / e2e (standalone, stable) (push) Has been cancelled
merge / bin-image-prepare (push) Has been cancelled
merge / module-image (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
ci / binary-finalize (push) Has been cancelled
ci / coverage (push) Has been cancelled
ci / release (push) Has been cancelled
merge / bin-image (push) Has been cancelled
merge / desktop-edge-test (push) Has been cancelled
fix(publish): bypass Docker Desktop proxy for loopback registries
`docker compose publish` routed all registry traffic through Docker
Desktop's HTTP proxy. Publishing to a registry on localhost therefore
failed on Windows with:

    proxyconnect tcp: open ./pipe/dockerHttpProxy: The system cannot
    find the path specified.

even though `docker push`/`docker pull` worked against the same registry.

Two bugs in internal/desktop/proxy.go:

1. No loopback bypass. ProxyTransport forced every request through the
   Docker Desktop proxy and its DialContext always dialed the proxy
   socket, so loopback targets could never connect directly. Proxy
   selection now bypasses the proxy only for loopback targets
   (localhost, 127.0.0.0/8, ::1); all other registry traffic stays
   routed through Docker Desktop's PAC-aware proxy so Desktop keeps
   ownership of proxy decisions (e.g. enterprise-managed proxies). The
   local process NO_PROXY/no_proxy is deliberately not honored, so a
   broad value such as * or .corp cannot bypass centrally managed
   proxy policy.

2. Malformed Windows pipe path. The proxy named-pipe endpoint was
   hardcoded as npipe://./pipe/..., yielding the relative path
   ./pipe/dockerHttpProxy. It is now derived from the engine endpoint,
   preserving its namespace. Docker Desktop reports the backslash form
   npipe://\\.\pipe\docker_cli, so the derivation uses LastIndexAny to
   handle both backslash and forward-slash forms.

Publishing to localhost now connects directly like `docker push`, while
every non-loopback registry still goes through the Docker Desktop proxy.

Fixes #13824

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Domantas Petrauskas <dom.petrauskas@gmail.com>
2026-06-15 21:18:19 +02:00
..
client.go feat: pre-filter Desktop Logs view by Compose project 2026-05-18 17:28:03 +02:00
client_test.go feat: pre-filter Desktop Logs view by Compose project 2026-05-18 17:28:03 +02:00
proxy.go fix(publish): bypass Docker Desktop proxy for loopback registries 2026-06-15 21:18:19 +02:00
proxy_test.go fix(publish): bypass Docker Desktop proxy for loopback registries 2026-06-15 21:18:19 +02:00