Repository navigation
feat: add support for HTTP, HTTPS proxy - #2748
Conversation
Signed-off-by: Sam Alba <[email protected]>
|
I know I'm not in the reviewers list, but I was one of the affected users. Just wanted to confirm that the content of this PR solves the issue of using dagger behind a corporative proxy. Setting the https_proxy and http_proxy properly makes it work. Tested with the todoapp example + proxy. Many thanks to @samalba for the fix and @grouville for prioritizing this issue in the backlog. Regards, |
jlongtine
left a comment
There was a problem hiding this comment.
LGTM! Do we want to add any tests for this?
I thought about it, but not sure how to: 1/ spin up a proxy automatically from the test suite and 2/ ensure in the tests that all connections go through it. If you have an idea to do this easily, let me know. |
|
There is this from the stdlib, but it doesn't handle the FTP case: https://pkg.go.dev/net/http#ProxyFromEnvironment |
|
@aluzzardi shared an idea: set an invalid proxy URL and verify that a curl fails in a task. That's not perfect, but at least it will guarantee that the connection goes through the proxy url. |
|
I've created a test in my fork: 67efa24 |
|
So it seems that buildkit ignore them in the case of image download through |
I think it's expected, given that docker.#Pull is aliased to core.#Pull which translates to: LLB directly: https://github.com/dagger/dagger/blob/0fffdc223bb9d6c103538ef2fbbf5ed6fb5f3950/plan/task/pull.go And this PR simply adds a RunOption so only exec will take the proxy into account. We should: 1/ add a simple test for this (I can do it), 2/ look for a way to support the proxy for core.#Pull and core.#Push (hopefully there is one!) |
Signed-off-by: Sam Alba <[email protected]>
Signed-off-by: Sam Alba <[email protected]>
353c91a to
df7ebe1
Compare
Adds support for HTTP and HTTPS Proxy. It translates the right env vars to LLB Run options.