Azure / container-service-for-azure-china

Container Service for Azure China
MIT License
422 stars 73 forks source link

dockerhub.azk8s.cn how to get the multiple path image #52

Closed wangshuai-007 closed 4 years ago

wangshuai-007 commented 5 years ago

In the hub.docker.com I want to get the dotnet core sdk like this command :docker pull mcr.microsoft.com/dotnet/core/sdk:2.2 and with dockerhub.azk8s.cn mirror,how can I get the right image this commond is not work:

docker pull dockerhub.azk8s.cn/mcr.microsoft.com/dotnet/core/sdk
Using default tag: latest
Error response from daemon: manifest for dockerhub.azk8s.cn/mcr.microsoft.com/dotnet/core/sdk:latest not found

docker pull dockerhub.azk8s.cn/microsoft/dotnet/core/sdk
Using default tag: latest
Error response from daemon: manifest for dockerhub.azk8s.cn/microsoft/dotnet/core/sdk:latest not found
andyzhangx commented 5 years ago

*.azk8s.cn only supports dockerhub, gcr.io, quay.io, does not support mcr.microsoft.com, you could pull that image directly on azure china. @w371987114

andyzhangx commented 4 years ago

We have set up a new proxy mcr.azk8s.cn for mcr.microsoft.com

tedchina commented 4 years ago

We have set up a new proxy mcr.azk8s.cn for mcr.microsoft.com

@andyzhangx I tried this proxy twice (today and 2 weeks ago) and could not see any docker pull speed improvement. Anything wrong?

I was trying to pull edgeagent of Azure IoT Ege as below.

xxx@u64ms:~$ sudo docker pull mcr.microsoft.com/azureiotedge-agent:1.0
xxx@u64ms:~$ sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
andyzhangx commented 4 years ago

sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0

@tecchina the second time docker pull would only costs 5s:

$ time sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
89d9c30c1d48: Pull complete
b02340cc0a47: Pull complete
32e673fc12c4: Pull complete
5cb5cd64ab44: Pull complete
92bd8804a353: Pull complete
ba8549933433: Pull complete
5e534609c714: Pull complete
Digest: sha256:51a62eff23c5d76c09182f6d6b85a3e6153393848a2ba032b92e4f61a2106d37
Status: Downloaded newer image for mcr.azk8s.cn/azureiotedge-agent:1.0

real    0m5.060s
user    0m0.082s
sys     0m0.012s
tedchina commented 4 years ago

@andyzhangx my 2nd pull was from scratch (i.e. no previously saved image) as well. I can understand an incremental pull will save time since the download size is much smaller. I meant I hadn't seen any downloading speed improvement with the proxy.

andyzhangx commented 4 years ago

@andyzhangx my 2nd pull was from scratch (i.e. no previously saved image) as well. I can understand an incremental pull will save time since the download size is much smaller. I meant I hadn't seen any downloading speed improvement with the proxy.

@tedchina We did not commit download speed improvement with the proxy. And what's your expectation?

tedchina commented 4 years ago

@andyzhangx Actually I did expect a speed improvement since the image pulling experience is horrible. I am fine and won't argue if that is beyond your plan or intention.

andyzhangx commented 4 years ago

@andyzhangx Actually I did expect a speed improvement since the image pulling experience is horrible. I am fine and won't argue if that is beyond your plan or intention.

@tedchina would do you mean "horrible"? could you paste your "time docker pull ..." result?

tedchina commented 4 years ago

In my 2 attempts in separate days, each of them took more than 5 hours to just pull the edgeAgent image.

andyzhangx commented 4 years ago

Not sure where have you tried, in my Azure VM, it's only 5s.

$ time sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
89d9c30c1d48: Pull complete
b02340cc0a47: Pull complete
32e673fc12c4: Pull complete
5cb5cd64ab44: Pull complete
92bd8804a353: Pull complete
ba8549933433: Pull complete
5e534609c714: Pull complete
Digest: sha256:51a62eff23c5d76c09182f6d6b85a3e6153393848a2ba032b92e4f61a2106d37
Status: Downloaded newer image for mcr.azk8s.cn/azureiotedge-agent:1.0

real    0m5.060s
user    0m0.082s
sys     0m0.012s
tedchina commented 4 years ago

Thanks @andyzhangx ... I just had a trial and confirm your proxy is now fast enough. The original repo is still as slow as my last two attempts of your proxy, however now your proxy is significantly faster, no matter started from scratch or after a suspended pull from the original repo. If nothing happened at your end, I have no clue why. One more piece of information is that my last 2 horrible attempts both took place on Sunday afternoons/evenings. Does this give you any clue?

ted@Magic-Ubuntu:~$ time sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
89d9c30c1d48: Pull complete 
b02340cc0a47: Pull complete 
32e673fc12c4: Pull complete 
5cb5cd64ab44: Pull complete 
92bd8804a353: Pull complete 
ba8549933433: Pull complete 
5e534609c714: Pull complete 
Digest: sha256:51a62eff23c5d76c09182f6d6b85a3e6153393848a2ba032b92e4f61a2106d37
Status: Downloaded newer image for mcr.azk8s.cn/azureiotedge-agent:1.0
mcr.azk8s.cn/azureiotedge-agent:1.0

real    0m29.206s
user    0m0.051s
sys 0m0.058s
ted@Magic-Ubuntu:~$ sudo docker images
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
mcr.azk8s.cn/azureiotedge-agent   1.0                 b768dff3bd78        13 days ago         140MB
hello-world                       latest              fce289e99eb9        15 months ago       1.84kB
ted@Magic-Ubuntu:~$ sudo docker rmi b768dff3bd78
Untagged: mcr.azk8s.cn/azureiotedge-agent:1.0
Untagged: mcr.azk8s.cn/azureiotedge-agent@sha256:51a62eff23c5d76c09182f6d6b85a3e6153393848a2ba032b92e4f61a2106d37
Deleted: sha256:b768dff3bd78328236ad3ea644fd43ce3c38bead65383677d58751fc753c536d
Deleted: sha256:05ca7f10a31bbfd1cb2a0cd06ed2fe1e95b224982fe9345e6a0f262e964351f3
Deleted: sha256:320791829d4a0e271660de25b021a829351ebb46390ed24cc9ae80dc0fd90d62
Deleted: sha256:4aab3bff3829d8f1517f25b136cb76273e0dffd59615ef3083bf8c735dbbd26a
Deleted: sha256:d00e8d1701de409e5521a35123af670a520a8be02263a2dc0c78e3166b7a9403
Deleted: sha256:564fa05beae02893ea148f09ff30e88e9d808ea35a679e015320e9c90fb2a0fe
Deleted: sha256:d5a301f96198cf03b3f08de139c539f3474a9d2c78747e1265360d46d54b220a
Deleted: sha256:77cae8ab23bf486355d1b3191259705374f4a11d483b24964d2f729dd8c076a0
ted@Magic-Ubuntu:~$ time sudo docker pull mcr.microsoft.com/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
89d9c30c1d48: Pulling fs layer 
b02340cc0a47: Downloading [====>                                              ]  227.5kB/2.382MB
32e673fc12c4: Downloading [>                                                  ]  309.4kB/29.74MB
5cb5cd64ab44: Waiting 
92bd8804a353: Waiting 
ba8549933433: Waiting 
5e534609c714: Pulling fs layer 
^C
real    3m5.020s
user    0m0.036s
sys 0m0.047s

ted@Magic-Ubuntu:~$ time sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0
1.0: Pulling from azureiotedge-agent
89d9c30c1d48: Pull complete 
b02340cc0a47: Pull complete 
32e673fc12c4: Pull complete 
5cb5cd64ab44: Pull complete 
92bd8804a353: Pull complete 
ba8549933433: Pull complete 
5e534609c714: Pull complete 
Digest: sha256:51a62eff23c5d76c09182f6d6b85a3e6153393848a2ba032b92e4f61a2106d37
Status: Downloaded newer image for mcr.azk8s.cn/azureiotedge-agent:1.0
mcr.azk8s.cn/azureiotedge-agent:1.0

real    0m9.611s
user    0m0.065s
sys 0m0.038s
ted@Magic-Ubuntu:~$ 
tedchina commented 4 years ago

BTW, I am in Shanghai with China Telecom fiber.

andyzhangx commented 4 years ago

@tedchina We detected slow docker pull issue and am now increasing the capacity. By the end of this week, the operation should be done.

tedchina commented 4 years ago

Glad to see you found the root cause and have a plan. Thanks ...

kztao commented 4 years ago

[root@promote ~]# sudo docker pull mcr.azk8s.cn/azureiotedge-agent:1.0 Trying to pull repository mcr.azk8s.cn/azureiotedge-agent ... Pulling repository mcr.azk8s.cn/azureiotedge-agent Error: Status 403 trying to pull repository azureiotedge-agent: "\r\n403 Forbidden\r\n<body bgcolor=\"white\">\r\n

403 Forbidden

\r\n
nginx/1.14.0 (Ubuntu)
\r\n\r\n\r\n"

andyzhangx commented 4 years ago

Note: currently *.azk8s.cn could only be accessed by Azure China IP, we don't provide public outside access any more. If you have such requirement to whitelist your IP, please contact akscn@microsoft.com, provide your IP address, we will decide whether to whitelist your IP per your reasonable requirement, thanks for understanding.