Skip to content

network: chain proxy requests via upstream proxy - #6996

Draft
gmarmstrong wants to merge 2 commits into
moby:masterfrom
gmarmstrong:proxy-chaining
Draft

network: chain proxy requests via upstream proxy#6996
gmarmstrong wants to merge 2 commits into
moby:masterfrom
gmarmstrong:proxy-chaining

Conversation

@gmarmstrong

@gmarmstrong gmarmstrong commented Jul 29, 2026

Copy link
Copy Markdown

Use proxy settings from the buildkitd environment to route requests from BuildKit's internal proxy through the configured upstream proxy. This adds the "double proxy" feature referenced in #6740 (comment).

This PR depends on #6995, which adds FilterProxyEnv. Once #6995 merges, I'll add ALL_PROXY and all_proxy to the shared proxy environment definition and remove some shared helper code from this branch's diff. I'll keep this PR in draft state until then.

Resolves #6991

Use proxy settings from the `buildkitd` environment to route requests from
BuildKit's internal proxy through the configured upstream proxy.

Signed-off-by: Guthrie McAfee Armstrong <git@gmarmstrong.dev>
@TommyLike

Copy link
Copy Markdown

Could the usage of the feature these two PRs add (#6995 + #6996) be documented in docs/proxy.md? A short usage section — how to enable upstream chaining, which buildkitd env vars it reads and their precedence, and the NO_PROXY behavior — would make the whole flow discoverable for users. Happy to send a small docs PR for it; I've been validating this end-to-end against a Squid caching gateway.

@gmarmstrong

Copy link
Copy Markdown
Author

Could the usage of the feature these two PRs add (#6995 + #6996) be documented in docs/proxy.md? A short usage section — how to enable upstream chaining, which buildkitd env vars it reads and their precedence, and the NO_PROXY behavior — would make the whole flow discoverable for users. Happy to send a small docs PR for it; I've been validating this end-to-end against a Squid caching gateway.

I don't believe #6995 needs additional documentation, because the docs already promise what it does. It's more of a bug fix than a feature.

As for this PR, I did add an "Upstream proxies" section already, but I can flesh it out a bit.

@gmarmstrong
gmarmstrong force-pushed the proxy-chaining branch 2 times, most recently from f23b4b7 to e055089 Compare August 12, 2026 18:05
Signed-off-by: Guthrie McAfee Armstrong <git@gmarmstrong.dev>
@TommyLike

Copy link
Copy Markdown

@gmarmstrong Built the image from this branch and tested it end-to-end against a Squid SSL-bump caching proxy: upstream chaining for RUN steps works, cache hits confirmed on repeat builds, and the system-trust-store approach for the upstream CA (SSL_CERT_FILE) works as designed. No further concerns from our side — hope this can land, as we're building our own build & caching clusters on top of it.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support chaining proxyNetwork through an upstream proxy

2 participants