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

registry mirror preference does not work [docker for mac]

Open AZLisme opened this issue 10 years ago • 6 comments

Expected behavior

after i set the registry mirror, docker pulling could be faster

Actual behavior

nothing happened, slow as always.

Information

Docker for Mac: version: 1.12.3 (583d1b8) OS X: version 10.12.1 (build: 16B2555) logs: /tmp/B5763BE2-3061-4024-BDED-3E442C95A54B/20161116-164348.tar.gz [OK] vmnetd [OK] dns [OK] driver.amd64-linux [OK] virtualization VT-X [OK] app [OK] moby [OK] system [OK] moby-syslog [OK] db [OK] env [OK] virtualization kern.hv_support [OK] slirp [OK] osxfs [OK] moby-console [OK] logs [OK] docker-cli [OK] menubar [OK] disk

Steps to reproduce the behavior

  1. Click docker preferences.
  2. Select Advance tab.
  3. add registry mirror url from daocloud.com.
  4. apply & restart
  5. docker pull anything , still slow
  6. I try docker info, it says the registry is "https://index.docker.io/v1/" (which is not the url i put in preference.)

AZLisme avatar Nov 16 '16 08:11 AZLisme

@AZLisme thanks for your report.

I can see in your logs that you have configured a registry mirror (not under daocloud.com though, which doesn't seem to habve anything to do with docker?) and that it has been correctly propagated to the daemon.json. I can also see the daemon attempting to talk to that mirror:

time="2016-11-16T08:32:12.519139628Z" level=debug msg="Trying to pull elasticsearch from https://«MIRROR» v2" 
time="2016-11-16T08:32:27.525118245Z" level=warning msg="Error getting v2 registry: Get https://«MIRROR»/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" 
time="2016-11-16T08:32:27.526347491Z" level=error msg="Attempting next endpoint for pull after error: Get https://«MIRROR»/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)" 
time="2016-11-16T08:32:27.527366450Z" level=debug msg="Trying to pull elasticsearch from https://registry-1.docker.io v2" 

So the daemon has timed out talking to your mirror and fallen back to registry-1.docker.io. Please can you double check the registry configuration and your connectivity to it, e.g. firewalls (local or national). Running curl https://«MIRROR»/v2/ should output {}.

Please also characterise what you mean by "slow" and "could be faster".

ijc avatar Nov 18 '16 13:11 ijc

@ijc25 thanks so much for responding.

By "slow" I mean: if I use default registry, it takes several hours to pull an images(around 500mb), due to network condition connecting abroad sites in China.

daocloud.io is Chinese docker registry mirror which accelerate the download (takes 30s to download same image).

According to your suggestions, I made some attempts:

  1. change my registry mirror back to daocloud's (I tried several mirror after and I forget that, sorry)
  2. I check the docker.log, and confirm that the daemon did try to connect to the daocloud mirror, but timed out again.
  3. I open my terminal, and tried curl http://<DAOCLOUD_MIRROR>/v2/, and it did outputs {}

That's curious, my connectivity with mirror is ok, but somehow the daemon could not connect to it.

Could it possible that it's my timeout setting problem, can I adjust the timeout threshold make the daemon not to time out a connection so soon?

AZLisme avatar Nov 19 '16 01:11 AZLisme

Sorry, it's https://www.daocloud.io, my typo. But the problem remains.

AZLisme avatar Nov 19 '16 01:11 AZLisme

Perhaps there's a problem with DNS resolution inside the VM. There have been a number of fixes to DNS in the beta channel. Could you try again with a recent beta (e.g. beta 33.1) https://download.docker.com/mac/beta/Docker.dmg

If it still reproduces with the beta, could you upload more diagnostics? The diagnostics in the beta channel are better, especially around DNS.

djs55 avatar Dec 19 '16 15:12 djs55

This issue has been inactive for more than 14 days while marked as status/0-more-info-needed. It is being closed due to abandonment. Please feel free to re-open with more information about the problem.

MORE_INFO_EXPIRY_TIMEOUT

balrajsingh avatar Jan 09 '17 17:01 balrajsingh

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

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

docker-robott avatar Jun 21 '20 03:06 docker-robott