-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http_proxy, https_proxy not honored by Dockerfile ADD instruction? #5329
Comments
This may be the same thing as #4643. |
@thaJeztah Any memory if this might have been intentional? I think we should use them if set with build-arg. Note that proxy settings do not apply to Atm. you should be able to work around it by setting |
In the original description of this ticket I said we run |
You need to define the proxy env when you are starting the buildkitd daemon, so depends on how you are doing it. The previous buildx command runs buildkitd in container and |
Hmm.. no, I don't think this was ever discussed, or a conscious decision.
So, that's actually an interesting point; I'm guessing I'm considering what's most logical here, and "least surprise";
Out of curiousity, I wondered what the classic builder used, and it looks like the classic builder uses the daemon proxy settings; Start the daemon with some proxy (I used HTTP_PROXY=http://example.com HTTPS_PROXY=http://example.com dockerd --debug Try a build with a echo -e 'FROM scratch\nADD https://github.com/containers/dnsname.git#v1.3.1 .' | DOCKER_BUILDKIT=0 docker build -
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
environment-variable.
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM scratch
--->
Step 2/2 : ADD https://github.com/containers/dnsname.git#v1.3.1 .
ADD failed: Get "https://github.com/containers/dnsname.git#v1.3.1": Bad Request Starting the daemon without proxy configured, and trying again; echo -e 'FROM scratch\nADD https://github.com/containers/dnsname.git#v1.3.1 .' | DOCKER_BUILDKIT=0 docker build -
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
environment-variable.
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM scratch
--->
Step 2/2 : ADD https://github.com/containers/dnsname.git#v1.3.1 .
Downloading 353.2kB
---> a014e8d6b763
Successfully built a014e8d6b763 |
So, from the above, at least it looks like BuildKit behaves different than the classic builder, which could be considered a regression. Whether the "build-arg" proxy, or "daemon" proxy should be used is still an interesting topic. The daemon may require a specific proxy (if the daemon is running in a different environment than the client). But a specific build requiring a specific proxy can be a very valid use-case as well. I'm still considering if we need explicit options to allow the user to decide, because either could be considered valid. (e.g. If "per build" proxies are considered for this; wondering if allowing different proxies for |
Thank you. We run buildkitd using docker. We pass
|
At Wikimedia Foundation we build buildkit releases locally to publish to our own registry. We build using buildkitd (currently v0.15.2). The node that buildkitd runs on does not have direct Internet access and must use a proxy. We pass
--opt build-arg:http_proxy="$http_proxy" --opt build-arg:https_proxy="$https_proxy" --opt build-arg:no_proxy="$no_proxy"
(with variable values coming from the environment) tobuildctl build
which generally works well. However, buildkit v0.16's Dockerfile started using instructions likeADD --keep-git-dir=true https://github.com/containers/dnsname.git#v1.3.1 .
These instructions are failing when we attempt to build buildkit v0.16:Other instructions which use the Internet work fine, for example:
It seems like whatever implements
ADD
(dockerfile-frontend, presumably) isn't honoring the proxy settings.The transcript of the failing job is available here: https://gitlab.wikimedia.org/repos/releng/buildkit/-/jobs/361358
The text was updated successfully, but these errors were encountered: