for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

NO_PROXY / no_proxy appears to be ignored when pulling images

Open spkane opened this issue 5 years ago • 18 comments

  • [x] I have tried with the latest version of Docker Desktop
  • [x] I have tried disabling enabled experimental features
  • [x] I have uploaded Diagnostics
  • Diagnostics ID: 94140753-E013-4E85-9093-1E9816B31DEB/20210714192944

Expected behavior

With this manual proxy setup in Docker for Mac:

http_proxy=proxy.example.com:81
https_proxy=proxy.example.com:81
no_proxy=localhost,127.0.0.1,172.16.0.0/12,192.168.0.0/16,.dev.example.com

I would expect that I could pull image from Docker Hub via the proxy and pull internal images from 'registry.dev.example.com', however this does not work. It appears as if no_proxy is ignored in this use case.

Actual behavior

When trying to pull from registry.dev.example.com it fails with a TLS error, very likely because it is trying to go through the proxy.

Error response from daemon: Get https://registry.dev.example.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Information

  • macOS Version: 10.15.7
  • Intel chip or Apple chip: Intel
  • Docker Desktop Version: 3.5.2

Steps to reproduce the behavior

  1. Be behind a proxy that can be used to access Docker Hub
  2. Have an internal registry that can be reached directly (and will not work when going through the proxy)
  3. Try to configure Docker so that you can pull images from both Docker Hub and the internal registry, as the same time.

spkane avatar Jul 14 '21 19:07 spkane

I just encountered this on my Mac as well. I have to turn on the proxy settings during my docker build process so that I can reach out to the public internet for stuff, but then I have to disable my proxy settings when I docker push my built image to a local container registry. It's kind of a pain, and it would be wonderful if this got fixed.

gfairchild avatar Jul 15 '21 17:07 gfairchild

And if you need both during something like a multi-stage build then there is basically nothing you can do. I am using an Ubuntu VM locally to work around this at the moment.

spkane avatar Jul 15 '21 22:07 spkane

I have been encountering this issue as well for some time now, kind of frustrating.

sudoloic avatar Jul 20 '21 12:07 sudoloic

It looks like this bug has been around for a while. I came across https://github.com/docker/for-mac/issues/2723 as well.

gfairchild avatar Jul 22 '21 16:07 gfairchild

Finding this to be quite problematic when using a local container registry that should not use the proxy.

Last seen working on version 3.3.2, anything newer does not respect the no proxy configuration.

mdsummers avatar Sep 09 '21 16:09 mdsummers

+1 need to restart the docker vm depending on if I am building or pushing to a registry, this is the worst thing I have to say about my mac :) #2723

ctrought avatar Sep 18 '21 00:09 ctrought

also running into this.

pboushy avatar Oct 28 '21 05:10 pboushy

Issues go stale after 90 days of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30 days of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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. /lifecycle stale

docker-robott avatar Jan 26 '22 01:01 docker-robott

/remove-lifecycle stale

spkane avatar Jan 26 '22 20:01 spkane

/lifecycle frozen

spkane avatar Jan 26 '22 20:01 spkane

Everyone at my workplace has this issue. We have to turn off proxy settings to get to pull images from a local servers.

This happens with all our macs Intel and M1 versions.

sei-amellinger avatar Feb 03 '22 16:02 sei-amellinger

hi, fixes around handling proxy settings have been released in 4.5.0. Could you update and confirm whether that resolves the issue you've been seeing?

p1-0tr avatar Feb 11 '22 10:02 p1-0tr

hi, fixes around handling proxy settings have been released in 4.5.0. Could you update and confirm whether that resolves the issue you've been seeing?

This does not resolve the issue I am seeing.

Just to confirm:

  • With the manual proxy set, I can pull images from docker hub.
  • With no proxy empty (maybe my proxy figures it out, it is supposed for other assets) I get: "Error response from daemon: Get "https:my-server": Bad Gateway"
  • With no proxy set to my domains I get: "Error response from daemon: Get "https:my-server": net/http: TLS handshake timeout"
  • If I turn manual proxy off I can get local assets.

Are there any diagnostics or logs available I can provide?

sei-amellinger avatar Feb 14 '22 14:02 sei-amellinger

I can not re-test this anymore, because I am no longer in the same environment, but I am hoping that others can test and confirm that this is fixed.

spkane avatar Feb 17 '22 03:02 spkane

this is still not fixed, on macos 12.3.1, running docker for mac 4.8.2.

colceagus avatar May 19 '22 15:05 colceagus

Same for me. On latest and still have to put in ip addresses/cidr ranges

On Thu, May 19, 2022, 11:49 AM Daniel Colceag @.***> wrote:

this is still not fixed, on macos 12.3.1, running docker for mac 4.8.2.

— Reply to this email directly, view it on GitHub https://github.com/docker/for-mac/issues/5844#issuecomment-1131894534, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI5V7IAHZ3LIO4PLIBAD653VKZPJDANCNFSM5AMCJ6TQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

rumstead avatar May 19 '22 16:05 rumstead

Still broken, it is unusable when interacting with anything not on my local machine. Last update made it even worse as it tries to refresh token from dockerhub when I login to a registry on local network... but that's not possible without proxy enabled, but then the internal registry cant be reached because it attempts to use proxy. Driving me crazy!

ctml91 avatar May 31 '22 03:05 ctml91

Still broken. Assuming you want to do docker login repo.artifactory.some.com, you will need to add the following values explicitly to the no_proxy list:

  • artifactory.some.com
  • repo.artifactory.some.com

This is just inconvenient for basically no reason, as far as I can tell.

Optimally users should be able to set *.some.com in the no_proxy and be done with it.

pliurbc avatar Jun 01 '23 16:06 pliurbc