Skip to content

fix: route OCI artifact pulls through Docker Desktop HTTP proxy#13770

Merged
glours merged 1 commit into
mainfrom
fix/oci-resolver-dd-proxy
May 18, 2026
Merged

fix: route OCI artifact pulls through Docker Desktop HTTP proxy#13770
glours merged 1 commit into
mainfrom
fix/oci-resolver-dd-proxy

Conversation

@glours
Copy link
Copy Markdown
Contributor

@glours glours commented May 4, 2026

What I did
The compose process performs OCI artifact fetches in-process via containerd's docker resolver, whose default transport only honors HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars. Users behind PAC-only corporate proxies hit i/o timeouts on oci:// includes and on compose publish.

When Docker Desktop is the active engine and exposes httpproxy.sock, route the resolver through it (PAC-aware). Falls back to the default transport when DD is unavailable or the socket is missing. Modeled on docker/mcp-gateway PR docker/mcp-gateway#354.

Related issue
Internal customer feedback

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

Copilot AI review requested due to automatic review settings May 4, 2026 12:30
@glours glours requested a review from a team as a code owner May 4, 2026 12:30
@glours glours requested a review from ndeloof May 4, 2026 12:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Compose’s OCI resolver usage so that, when Docker Desktop is the active engine and exposes httpproxy.sock, OCI registry traffic is routed through Docker Desktop’s PAC-aware HTTP proxy (improving behavior in PAC-only corporate proxy environments). It falls back when Docker Desktop/proxy socket detection fails.

Changes:

  • Add internal/desktop helpers to detect the Docker Desktop endpoint and build an HTTP transport that dials via httpproxy.sock.
  • Extend internal/oci.NewResolver to accept an optional http.RoundTripper, and thread that through oci:// remote loads and compose publish.
  • Add unit tests for the new proxy endpoint derivation and for ensuring the resolver uses a supplied transport.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pkg/remote/oci.go Lazily initializes a resolver HTTP transport (via Docker Desktop proxy when available) and passes it into the OCI resolver for oci:// includes.
pkg/compose/publish.go Routes OCI publish traffic through Docker Desktop’s proxy transport when available.
pkg/compose/desktop.go Refactors Desktop endpoint detection to use internal/desktop.Endpoint.
internal/oci/resolver.go Adds a transport http.RoundTripper parameter to NewResolver and wires it into registry client configuration.
internal/oci/resolver_test.go Verifies NewResolver actually uses a provided transport and accepts nil transport.
internal/desktop/proxy.go Introduces Docker Desktop endpoint discovery and proxy transport construction (dialing httpproxy.sock).
internal/desktop/proxy_test.go Tests proxy socket endpoint derivation and transport fallback/routing behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/desktop/proxy.go Outdated
Comment thread internal/desktop/proxy.go
glours added a commit that referenced this pull request May 4, 2026
Address Copilot review on #13770:

- ProxyTransport now clones http.DefaultTransport and overrides only
  Proxy and DialContext, keeping stdlib timeouts, idle pool, and HTTP/2
  defaults (was a bare *http.Transport that dropped them).
- When DD is unavailable or detection fails, return nil instead of
  http.DefaultTransport so oci.NewResolver lets containerd use its own
  built-in default transport — preserving prior behavior for non-DD
  users.
glours added a commit that referenced this pull request May 4, 2026
Address Copilot review on #13770:

- ProxyTransport now clones http.DefaultTransport and overrides only
  Proxy and DialContext, keeping stdlib timeouts, idle pool, and HTTP/2
  defaults (was a bare *http.Transport that dropped them).
- When DD is unavailable or detection fails, return nil instead of
  http.DefaultTransport so oci.NewResolver lets containerd use its own
  built-in default transport — preserving prior behavior for non-DD
  users.

Signed-off-by: Guillaume Lours <[email protected]>
@glours glours force-pushed the fix/oci-resolver-dd-proxy branch from cd6cc46 to 8a8a913 Compare May 4, 2026 12:41
@glours glours requested a review from Copilot May 4, 2026 12:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/desktop/proxy.go
Comment thread internal/desktop/proxy.go Outdated
Comment thread internal/oci/resolver_test.go
The compose process performs OCI artifact fetches in-process via
containerd's docker resolver, whose default transport only honors
HTTP_PROXY/HTTPS_PROXY/NO_PROXY env vars. Users behind PAC-only
corporate proxies hit i/o timeouts on `oci://` includes and on
`compose publish`.

When Docker Desktop is the active engine and exposes httpproxy.sock,
route the resolver through it (PAC-aware). Falls back to the default
transport when DD is unavailable or the socket is missing. Modeled on
docker/mcp-gateway PR #354.

Signed-off-by: Guillaume Lours <[email protected]>
@glours glours force-pushed the fix/oci-resolver-dd-proxy branch from 4a29b97 to 9fb96a5 Compare May 4, 2026 12:54
@glours glours self-assigned this May 12, 2026
@glours glours merged commit 66c21c3 into main May 18, 2026
42 checks passed
@glours glours deleted the fix/oci-resolver-dd-proxy branch May 18, 2026 08:53
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request May 21, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | patch | `v5.1.3` → `v5.1.4` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>docker/compose (docker/compose)</summary>

### [`v5.1.4`](https://github.com/docker/compose/releases/tag/v5.1.4)

[Compare Source](docker/compose@v5.1.3...v5.1.4)

#### What's Changed

##### ✨ Improvements

- feat: add stop lifecycle hook for external providers by [@&#8203;glours](https://github.com/glours) in [#&#8203;13779](docker/compose#13779)

##### 🐛 Fixes

- fix: route OCI artifact pulls through Docker Desktop HTTP proxy by [@&#8203;glours](https://github.com/glours) in [#&#8203;13770](docker/compose#13770)
- fix: restore stoppingEvent/stoppedEvent helpers for plugin stop hook by [@&#8203;glours](https://github.com/glours) in [#&#8203;13794](docker/compose#13794)
- fix(publish): flag literal inline environment values by [@&#8203;glours](https://github.com/glours) in [#&#8203;13760](docker/compose#13760)

##### 🔧  Internal

- ci: remove unused e2e job from merge workflow by [@&#8203;glours](https://github.com/glours) in [#&#8203;13740](docker/compose#13740)
- chore: update cagent-action to `v1.4.4` by [@&#8203;derekmisler](https://github.com/derekmisler) in [#&#8203;13745](docker/compose#13745)
- Change verb tense in Docker Compose reference documentation by [@&#8203;ryanjbonnell](https://github.com/ryanjbonnell) in [#&#8203;13773](docker/compose#13773)
- pkg/compose: go fix by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13782](docker/compose#13782)
- refactor: code deduplication and simplification by [@&#8203;ndeloof](https://github.com/ndeloof) in [#&#8203;13759](docker/compose#13759)
- fix: make e2e tests pass reliably locally with Docker Desktop by [@&#8203;glours](https://github.com/glours) in [#&#8203;13741](docker/compose#13741)
- refactor: drop Desktop beta-settings check; gate hint on LogsTab flag by [@&#8203;glours](https://github.com/glours) in [#&#8203;13755](docker/compose#13755)

##### ⚙️ Dependencies

- build(deps): bump github.com/mattn/go-shellwords from `1.0.12` to `1.0.13` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13731](docker/compose#13731)
- build(deps): bump github.com/docker/cli from `29.4.0+incompatible` to `29.4.2+incompatible` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13768](docker/compose#13768)
- build(deps): bump github.com/moby/moby/client from `0.4.0` to `0.4.1` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13752](docker/compose#13752)
- build(deps): bump github.com/docker/cli from `29.4.2+incompatible` to `29.4.3+incompatible` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13776](docker/compose#13776)
- build(deps): bump google.golang.org/grpc from `1.80.0` to `1.81.0` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13775](docker/compose#13775)
- build(deps):  update to `go 1.26.3` by [@&#8203;thaJeztah](https://github.com/thaJeztah) in [#&#8203;13783](docker/compose#13783)
- build(deps): bump google.golang.org/grpc from `1.81.0` to `1.81.1` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13791](docker/compose#13791)
- build(deps): bump github.com/compose-spec/compose-go/v2 from `2.10.2` to `2.11.0` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13798](docker/compose#13798)
- build(deps): bump github.com/docker/cli from `29.4.3+incompatible` to `29.5.1+incompatible` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13796](docker/compose#13796)
- build(deps): bump golang.org/x/sys from `0.42.0` to `0.44.0` by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;13788](docker/compose#13788)

#### New Contributors

- [@&#8203;ryanjbonnell](https://github.com/ryanjbonnell) made their first contribution in [#&#8203;13773](docker/compose#13773)

**Full Changelog**: <docker/compose@v5.1.3...v5.1.4>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xODYuNCIsInVwZGF0ZWRJblZlciI6IjQzLjE4Ni40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants