You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support http/https proxy for core.#GitPull, core.#HTTPFetch, core.#Pull #2756
PR #2748 added support for HTTP and HTTPS proxy from environment variables inside actions tasks. However it actually supports proxies for anything using core.#Exec. The proxy env vars will be ignored for other ops involving network connections: core.#GitPull, core.#HTTPFetch, core.#Pull.
It's not critical as most packages are built on top of core.#Exec. Also, not sure if there is a proper way to support proxies outside of a llb Exec.
After a few investigation, I couldn't see some llb.WithProxy that would return some PullOption instead of RunOption.
So I investigated more, and found that even launching the buildkitd container with https_proxy env var set doesn't make it contact any proxy at all.
So I guess it would be some upstream issue, unless I'm mistaken.
error="failed to do request: Head \"https://registry-1.docker.io/v2/library/debian/manifests/latest\": proxyconnect tcp: dial tcp 1.2.3.4:80: i/o timeout" host=registry-1.docker.io
Of course that's not enough to be able to set a proxy per-op - but then I'm wondering if that's really a use-case worth addressing?
eg: having to use a proxy seems to me like something you want globally, all the time - so in that case it seems to make more sense to just start buildkitd manually with the appropriate env rather than having to somehow stuff that into plans / actions.
Interesting, this did not work when I tried it on dagger-buildkitd (the buildkitd that dagger starts automatically). Maybe it was due to my dev env. Either way, if this is true, it's trivial to fix by optionally add the env vars on the docker run cli if they are present on the host:
Interesting, this did not work when I tried it on dagger-buildkitd (the buildkitd that dagger starts automatically). Maybe it was due to my dev env. Either way, if this is true, it's trivial to fix by optionally add the env vars on the docker run cli if they are present on the host
That's what I tried in my experimentations, and even that didn't work, which made me think it was more of an upstream issue.
Activity
dolanor commentedon Jul 7, 2022
After a few investigation, I couldn't see some
llb.WithProxythat would return somePullOptioninstead ofRunOption.So I investigated more, and found that even launching the buildkitd container with
https_proxyenv var set doesn't make it contact any proxy at all.So I guess it would be some upstream issue, unless I'm mistaken.
related: moby/buildkit#971
spacedub commentedon Jul 15, 2022
@dolanor AFAIK buildkitd does honor the usual env vars for pull and push:
docker run --rm --env HTTPS_PROXY=1.2.3.4 --env HTTP_PROXY=1.2.3.4 --privileged --name buildkitd -ti moby/buildkitWill end with:
error="failed to do request: Head \"https://registry-1.docker.io/v2/library/debian/manifests/latest\": proxyconnect tcp: dial tcp 1.2.3.4:80: i/o timeout" host=registry-1.docker.ioThe code responsible for that seems to be here: https://github.com/moby/buildkit/blob/a45b7698dcc14aea3b42ea8bbba39a39381e18f1/util/resolver/resolver.go#L187
Of course that's not enough to be able to set a proxy per-op - but then I'm wondering if that's really a use-case worth addressing?
eg: having to use a proxy seems to me like something you want globally, all the time - so in that case it seems to make more sense to just start buildkitd manually with the appropriate env rather than having to somehow stuff that into plans / actions.
2 cents.
Hope that helps.
samalba commentedon Jul 19, 2022
Interesting, this did not work when I tried it on dagger-buildkitd (the buildkitd that dagger starts automatically). Maybe it was due to my dev env. Either way, if this is true, it's trivial to fix by optionally add the env vars on the
docker runcli if they are present on the host:dagger/util/buildkitd/buildkitd.go
Line 230 in 0a2445d
dolanor commentedon Aug 16, 2022
That's what I tried in my experimentations, and even that didn't work, which made me think it was more of an upstream issue.