-
Notifications
You must be signed in to change notification settings - Fork 118
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 settings from preferences are injected as environment variables in containers #981
Comments
|
@ebriney That might be a workaround but it doesn't solve the issue. I'm hoping that setting the HTTP Proxy settings in the app preferences will have the same effect as setting the environment variables for the docker daemon in systemd. See: https://docs.docker.com/engine/admin/systemd/#/http-proxy When doing the above the HTTP Proxy environment variables do not get injected into containers. It should be the same on macOS. These settings are only for enabling a connection to Docker registries through a proxy. |
Strongly agree, this behavior where a proxy I happen to be using for web browsing on my mac automatically and without my choice gets injected into all containers seems a bit nuts. This feature, although documented (https://docs.docker.com/docker-for-mac/networking/), is too clever, causes more confusion than it's worth. Let users enter the proxy in the Docker Preferences tab, anyway there's no guarantee you'd want to use the same proxy the Mac is otherwise using. And a really bad bug is that Docker for Mac doesn't "reset" this after "unchecking" "Web Proxy (HTTP)" in Settings => Network => Proxies tab. The old value is still in the Docker Preferences, grayed out. I have to actually delete the ip and port from the Mac settings, even though those fields are being ignored by the Mac. |
Thanks for the report. I've escalated this to the Docker for Mac and Windows networking team. We hope to work on our support for HTTP proxies over the next few releases -- I'll let you know how we get on. |
@lukevella the latest master builds of Docker for Mac have experimental support for transparent HTTP(S) proxying. If this special mode is enabled then no environment variables are rewritten. If you'd like to try it, I've written some instructions: https://github.com/moby/vpnkit/blob/master/docs/transparent-http-proxy.md (Note the current implementation doesn't currently support Feedback is very welcome! |
The problem has become extremely urgent, without the |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
@djs55 I think this issue may be resolved better. Let me explain the problem I encounter first:
I think the key problem is that the proxy to pull images and the proxy for container(vpn passthrough) shouldn't be mixed. They are completely for different purpose. Providing two separate setting might be a better solution. |
Funny that I have reverse problem with Docker for Windows: proxy configuration from docker settings is not injected into containers. |
Was this issue ever resolved? I have a problem similar to the original issue. My Jenkins server has proxy setting for both docker engine and docker containers. I need a proxy to build containers and install container binaries (apt-get, npm install etc) but I do not require proxy settings injected into containers after install. The docker engine proxy settings are added via: The docker container proxy settings are added via: My jenkins job will build containers locally and deploy to my development environment but the proxy settings are injected into the containers. This prevents communication between containers since they try to speak to each other via proxy. |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
Expected behavior
I am behind a corporate proxy so I configured the preferences with an HTTP Proxy so that I can pull images from Docker Hub when building my containers, but don't expect the same settings to be injected into the containers as environment variables.
Actual behavior
The images are pulled successfully through the proxy however, the same HTTP Proxy settings are being injected in to the containers as environment variables. This causes some issues since I am using docker-compose to link two containers and they are attempting to communicate with each other through the proxy (which fails). I tried to exclude the hostnames of the linked containers via the preferences, hoping that they will be injected as $NO_PROXY but this doesn't happen.
Steps to reproduce the behavior
HTTP_PROXY:
http://proxy.co.corp:8080
Exclude:
localhost,co.corp
output:
http://proxy.co.corp:8080
output: empty
The text was updated successfully, but these errors were encountered: