build: make proxy build-arg override check case-insensitive#3697
Open
crazy-max wants to merge 1 commit intodocker:masterfrom
Open
build: make proxy build-arg override check case-insensitive#3697crazy-max wants to merge 1 commit intodocker:masterfrom
crazy-max wants to merge 1 commit intodocker:masterfrom
Conversation
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
thaJeztah
reviewed
Mar 5, 2026
Comment on lines
+174
to
+175
| name: "case insensitive match", | ||
| proxyArgs: map[string]string{"no_proxy": "cli"}, |
Member
There was a problem hiding this comment.
I know in the CLI and daemon we only consider NO_PROXY and no_proxy, but don't consider nO_pRoXy; perhaps worth considering.
(I can dig up a link to the code if needed)
Member
There was a problem hiding this comment.
e.g.;
Also possibly relevant; if either HTTP_PROXY or http_proxy is set, we set both (because upper/lowercase depends on implementation, and there's no official standard)
https://github.com/moby/moby/blob/83bca512aa7ffc1bb4f37ce1107e0d3e3489ad43/daemon/command/daemon.go#L1119-L1132
func configureProxyEnv(ctx context.Context, cfg config.Proxies) {
if p := cfg.HTTPProxy; p != "" {
overrideProxyEnv(ctx, "HTTP_PROXY", p)
overrideProxyEnv(ctx, "http_proxy", p)
}
if p := cfg.HTTPSProxy; p != "" {
overrideProxyEnv(ctx, "HTTPS_PROXY", p)
overrideProxyEnv(ctx, "https_proxy", p)
}
if p := cfg.NoProxy; p != "" {
overrideProxyEnv(ctx, "NO_PROXY", p)
overrideProxyEnv(ctx, "no_proxy", p)
}
}
Member
|
I guess we should also fix it in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #3636
Buildx currently checks whether a proxy default should be injected using a case-sensitive map lookup, so
--build-arg no_proxy=...does not block injectingNO_PROXYfrom~/.docker/config.json.That can result in both
build-arg:no_proxyandbuild-arg:NO_PROXYbeing sent to BuildKit and because BuildKit resolves proxy args case-insensitively from a Go map, the winning value can vary by map iteration order.With this patch, Buildx uses a case-insensitive key existence check before injecting proxy defaults, so an explicit CLI proxy arg consistently takes precedence. This aligns behavior with user expectation that explicit
--build-argvalues should deterministically override config defaults.