-
Notifications
You must be signed in to change notification settings - Fork 291
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
Build and proxies #897
Comments
Happy to contribute time, docs, or code just point me at where to look :). |
I saw the VPN tag, maybe that should be added here as well? |
Isn't this issue about proxies, which is separate from VPN? I would agree though that we probably should have a bunch more labels, like |
Yea it's about proxies but I only use proxies because I am on my company's VPN haha. If it doesn't fit that label, no worries. Just thought I would highlight it. |
@rumstead
Perhaps the following command will work.
|
Why would adding a lower case no proxy env impact pulling images? |
Sorry, Not related to this, but "my-private-registry.example.com" was not needed for "--build-arg NO_PROXY=~". The reason I added |
Can I tell nerdctl only at buildtime if it should use a proxy or not? I didn't find a flag to configure this at every call - so I can use a alias to do the job ... HTTP-PROXY configuration? CONTAINER-PROXY configuration? If someone have an idea it would be great! Thanks. |
Same issues with docker not just nerdctl. |
I was able to get around my issue by setting proxies on the docker init.d and restarting the docker service.
@jandubois - I see this persisted even when I close rancher desktop or do a lima shutdown 0. Are these files persisted on the underlying host? Any docs I can read? |
A more elegant but less-than-ideal solution... Using overrides to toggle between using a proxy and not. Proxies: provision:
- mode: system
script: |
cat <<EOF > /tmp/proxy.sh
#!/bin/sh
export http_proxy="http://foo.com"
export https_proxy="http://foo.com"
export no_proxy=kubernetes.docker.internal,127.0.0.1,127.0.0.0/8
export ftp_proxy="ftp://foo.com/"
export all_proxy="http://foo.com"
export HTTP_PROXY="http://foo.com"
export HTTPS_PROXY="http://foo.com"
export NO_PROXY=kubernetes.docker.internal,127.0.0.1,127.0.0.0/8
export FTP_PROXY="ftp://foo.com/"
export ALL_PROXY="http://foo.com"
EOF
echo ". /tmp/proxy.sh" | sed -i -e '7r /dev/stdin' /etc/init.d/docker
echo ". /tmp/proxy.sh" | sed -i -e '9r /dev/stdin' /etc/init.d/containerd No Proxies provision:
- mode: system
script: |
sed -i 's/. \/tmp\/proxy.sh//' /etc/init.d/docker
sed -i 's/. \/tmp\/proxy.sh//' /etc/init.d/containerd You have to restart rancher desktop or restart the Lima VM. A similar approach works with windows as well except the files need to end in EDIT: Added containerd |
How to pass windows env to WSL2 to be used by nerdctl.
|
Are there any docs on how to use proxies with rancher desktop and the underlying components (lima and nerdctl)? I have seen a couple of issues (#384, #699) around proxies/env variables but I can't find any docs or a clear path forward for setting them and being able to build. I am happy to contribute a README or something after this is sorted.
For bugs, describe what you're seeing
I was able to get rancher desktop to launch by setting the http/https env variables, but get issues building images that need to come through a proxy.
During a build, my internal image pulls fine but the external gcr.io one times out. I did try adding build-args with the envs but didn't work (described here moby/buildkit#971)
But
nerdctl pull
works "outside" the VMnerdctl pull
also works "inside" the VMlima vm has my proxies
To Reproduce
Steps to reproduce the behaviour:
Result
Try to build an image referencing a public image behind a proxy.
Expected behaviour
Public image can be pulled and used as a base image during an image build.
Screenshots
If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: