Skip to content
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

Docker Desktop for Mac is ignoring proxy settings #6481

Open
3 tasks done
nikban95 opened this issue Sep 13, 2022 · 10 comments
Open
3 tasks done

Docker Desktop for Mac is ignoring proxy settings #6481

nikban95 opened this issue Sep 13, 2022 · 10 comments

Comments

@nikban95
Copy link

nikban95 commented Sep 13, 2022

  • I have tried the latest version of Docker Desktop
  • I have tried disabling enabled experimental features
  • I have uploaded Diagnostics: 9D7A54BD-7E00-4431-981A-A9E434C0125E/20220913164824

Expected behavior

Proxy settings should not be ignored.

Actual behavior

I'm behind a corporate proxy and use a locally running cisco anyconnect to connect with the corporate proxy.
In the Docker Desktop dashboard under "Settings" -> "Resources" -> "PROXIES," I switch on "Manual proxy configuration" and set the addresses of "Web Server (HTTP)" and "Secure Web Server (HTTPS)" pointing to my corporate vpn address.

image

This seems to be ignored by docker and I still cannot access the docker registry if trying one of the examples:
~ % docker run --name repo alpine/git clone https://github.com/docker/getting-started.git 
Unable to find image 'alpine/git:latest' locally
docker: Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

Also in docker info, the proxy doesn't seem to be set. Please find the output of docker info below:

~ % docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc., v0.9.1)
  compose: Docker Compose (Docker Inc., v2.10.2)
  extension: Manages Docker extensions (Docker Inc., v0.2.9)
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc., 0.6.0)
  scan: Docker Scan (Docker Inc., v0.19.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
  cgroupns
 Kernel Version: 5.10.124-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 4
 Total Memory: 7.667GiB
 Name: docker-desktop
 ID: 2EXT:NHKU:WCVL:BLND:BZDE:4ODF:2OP2:I6CD:53YW:IVXL:4674:EWBK
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal,tharbor-1.airtel.com*
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5000
  127.0.0.0/8
 Live Restore Enabled: false

Information

  • Is it reproducible? Yes
  • macOS Version: 12.5.1
  • Intel chip or Apple chip: Apple chip
  • Docker Desktop Version: Docker Desktop 4.12.0 (85629)

Steps to reproduce the behavior

See above

@pboushy
Copy link

pboushy commented Oct 4, 2022

I seem to be seeing this issue too.
and my coworker is able to reproduce it.
I have submitted a support ticket.

@yuesh1
Copy link

yuesh1 commented Oct 27, 2022

same

@jlvahldiek
Copy link

Setting the HTTPS_PROXY env variable using export HTTPS_PROXY=http://proxy.host.com:8080 as described in https://docs.docker.com/desktop/settings/mac/#proxies solved the issue for me.

@docker-robott
Copy link
Collaborator

There hasn't been any activity on this issue for a long time.
If the problem is still relevant, mark the issue as fresh with a /remove-lifecycle stale comment.
If not, this issue will be closed in 30 days.

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

/lifecycle stale

@ap0phi5
Copy link

ap0phi5 commented Apr 13, 2023

/remove-lifecycle stale
/lifecycle frozen

@ap0phi5
Copy link

ap0phi5 commented Apr 13, 2023

Also having this issue. I'm wondering if this is caused by this...

https://docs.docker.com/desktop/settings/mac/#proxies

If the host uses a HTTP/HTTPS proxy configuration (static or via Proxy Auto-Configuration), Docker Desktop reads this configuration and automatically uses these settings for logging into Docker, for pulling and pushing images, and for container Internet access.

What is not clear is the order of precedence and how any proxy auto-configuration can be overridden. If auto-configuration does take precedence, it is not clear as a lot of folks are banging their heads on why their Docker Desktop proxy config is not being picked up.

@JokerDevops
Copy link

I have also encountered this problem, and currently it has not been well resolved.

image image He did not automatically add it to the container.

@lyfsn
Copy link

lyfsn commented Nov 7, 2023

Refer to the docs: https://docs.docker.com/network/proxy/

I resolved the issue by editing ~/.docker/config.json:

"proxies": {
  "default": {
    "httpProxy": "http://host.docker.internal:7890",
    "httpsProxy": "http://host.docker.internal:7890",
    "noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
  }
}

Note that you should use host.docker.internal instead of 127.0.0.1.

@pboushy
Copy link

pboushy commented Nov 7, 2023

Refer to the docs: https://docs.docker.com/network/proxy/

I resolved the issue by editing ~/.docker/config.json:

"proxies": {
  "default": {
    "httpProxy": "http://host.docker.internal:7890",
    "httpsProxy": "http://host.docker.internal:7890",
    "noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
  }
}

Note that you should use host.docker.internal instead of 127.0.0.1.

I appreciate the workaround, but we shouldn't be having to do this 14 months later.
Can Docker please fix this already?

@wiegell
Copy link

wiegell commented Dec 19, 2023

I tried all workarounds today, but nothing works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants