Docker Community Forums

Share and learn in the Docker community.

Cannot pull images due to slow download speed

Hi, I’ve got a problem when trying to pull images from the official docker registry. Everytime I start a pull it downloads relatively fast at the beginning but rapidly decreases download speeds to about 20-70 kbit/s, so it takes forever to complete (> 30-45 mins depending on which image). This especially happens with large layers.
Everything else is using normal download speeds, so my connection seems to be fine.

I did run mtr which outputs the following after running it for 30 minutes minimum:

My traceroute  [v0.93]
DESKTOP(*.*.*.*)                                   2022-01-10T21:05:49+0100
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                        Packets            Pings
 Host                             Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. DESKTOP                       0.0%  5198    0.2   0.1   0.1   1.1   0.1
 2. fritz.box                     0.0%  5198    0.9   0.8   0.6  17.0   0.9
 3. p3e9bf6dd.dip0.t-ipconnect.de 0.0%  5198   14.0  17.7   4.2  87.8   9.4
 4. ewr-sa1-i.EWR.US.NET.DTAG.DE  0.1%  5198  129.4 110.4  91.8 495.9  22.2
    ewr-sa1-i.EWR.US.NET.DTAG.DE
    was-sa3-i.WAS.US.NET.DTAG.DE
 5. 62.157.248.123                0.1%  5198  107.6 107.0  91.1 153.6   3.7
    62.159.61.87
 6. 150.222.87.251               96.7%  5198   91.0  99.8  90.7 112.0   2.9
 7. 52.93.59.83                  95.4%  5198   93.4 105.0  90.1 141.0   5.9
 8. (waiting for reply)
 9. 52.93.28.74                   4.6%  5198  100.4  99.7  98.8 161.3   3.6
10. (waiting for reply)
11. (waiting for reply)
12. (waiting for reply)
13. (waiting for reply)
14. 52.93.28.80                  99.0%  5198  109.5 110.4 108.8 124.7   3.3
15. 52.93.28.74                  96.5%  5198   97.8 109.6  97.2 127.5   3.6
16. (waiting for reply)

I can see that at some point there is a massive loss of packets. Using dig index.docker.io I can see that it should be trying to connect to us-east-1 of aws:

;; QUESTION SECTION:
;index.docker.io.               IN      A

;; ANSWER SECTION:
index.docker.io.        0       IN      CNAME   elb-io.us-east-1.aws.dckr.io.
elb-io.us-east-1.aws.dckr.io. 0 IN      CNAME   us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com.
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 52.55.53.172
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 54.85.207.112
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 34.231.195.77
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 3.231.52.87
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 34.198.0.87
us-east-1-elbio-rm5bon1qaeo4-623296237.us-east-1.elb.amazonaws.com. 0 IN A 34.202.228.80

However using windows resource monitor it seems that vpnkit.exe is accessing e.g. 104.18.123.25 which should be an ip belonging to cloudflare with a download speed of ~20-70 kbit/s, so maybe there is a bottleneck?

Does anyone else have problems like this? Its so slow that I really cannot work with docker at the moment.

Windows 10 21H2 19044.1415
Docker Desktop Version 4.3.2 (72729)
Engine: 20.10.11
Compose: v2.2.1

Can you tell me an example what image you are trying to download so I can try if it is slow for me too? I didn’t notice any speed issue, but it could depend on your location. How long have you been trying to pull images with this speed?

Sorry for the late reply. It has been like this for weeks now, unfortunately I don’t know it more precise. I actually completely reinstalled my system, not necessarily because of this problem, but it didn’t help either.

It happens with all images I tried so far, I just ran pull for postgres:

    ~ ──────────────────────────────────────────────────────── at 18:58:41 
❯ time docker pull postgres
Using default tag: latest
latest: Pulling from library/postgres
a2abf6c4d29d: Pull complete
e1769f49f910: Pull complete
33a59cfee47c: Pull complete
461b2090c345: Pull complete
8ed8ab6290ac: Pull complete
495e42c822a0: Pull complete
18e858c71c58: Pull complete
594792c80d5f: Pull complete
794976979956: Pull complete
eb5e1a73c3ca: Pull complete
6d6360292cba: Pull complete
131e916e1a28: Pull complete
757a73507e2e: Pull complete
Digest: sha256:f329d076a8806c0ce014ce5e554ca70f4ae9407a16bb03baa7fef287ee6371f1
Status: Downloaded newer image for postgres:latest
docker.io/library/postgres:latest
docker pull postgres  0.18s user 0.15s system 0% cpu 5:08.15 total

or jboss/keycloak:

    ~ ──────────────────────────────────────────────────────── at 19:17:06 
❯ time docker pull jboss/keycloak
Using default tag: latest
latest: Pulling from jboss/keycloak
ac10f00499d5: Pull complete
96d53117c12e: Pull complete
6c765d9e2ec8: Pull complete
82c9b130dd92: Pull complete
0a1b7d7fb8e1: Pull complete
Digest: sha256:6ecb9492224c6cfbb55d43f64a5ab634145d8cc1eba14eae8c37e3afde89546e
Status: Downloaded newer image for jboss/keycloak:latest
docker.io/jboss/keycloak:latest
docker pull jboss/keycloak  0.43s user 0.21s system 0% cpu 25:43.00 total

Pulling postgres takes 5:08 minutes and keycloak takes 25:43 minutes

I also think it could have something to do with my location or ISP. I’m in Germany with Telekom as my internet provider. Speedtests are looking good and other applications don’t seem to be affected:

     Server: intersaar GmbH - Saarbrucken (id = 3692)
        ISP: Deutsche Telekom AG
    Latency:    10.33 ms   (0.20 ms jitter)
   Download:   104.71 Mbps (data used: 85.3 MB )
     Upload:    32.03 Mbps (data used: 14.4 MB )
Packet Loss:     0.0%

Thanks for your help!

“for weeks” is perfectly enough

How did you run dig and mtr on Windows?

Both of them are fast for me. From which country are you trying to pull the images? I would try from there (if I can) using Surfshark vpn. If the country is not the issue, then something must be in your network or your internet provider’s network.

Thanks for trying!

I used WSL2 with Ubuntu, I forgot to mention that. But its the same behavior using Powershell.

I’m trying to pull from Germany. I noticed that npm also has that issue, so it can’t be specific to docker. An mtr to registry.npmjs.org showed packetloss with cloudflare, so I ran mtr with cloudflare.com:

My traceroute  [v0.93]
DESKTOP-MC39TRC (*.*.*.*)                                   2022-01-13T20:21:23+0100
Keys:  Help   Display mode   Restart statistics   Order of fields   quit
                                        Packets               Pings
 Host                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. DESKTOP                           0.0%  1245    0.3   0.2   0.1   1.2   0.1
 2. fritz.box                         0.2%  1245    0.8   0.9   0.6  20.6   1.2
 3. p3e9bf6dd.dip0.t-ipconnect.de     0.0%  1245   12.3   6.2   4.1  85.2   6.3
 4. pd900c8f2.dip0.t-ipconnect.de     0.1%  1244    8.2 321.9   8.1 5450. 815.9
 5. pd900c8f2.dip0.t-ipconnect.de     0.1%  1244    8.3 308.6   7.3 5339. 812.0
 6. 62.157.250.38                     0.0%  1244    8.0  13.4   7.4  83.9   7.5
 7. ae9.francoforte73.fra.seabone.net 0.0%  1244    8.1  14.0   7.5  91.2  10.3
 8. cloudflare.francoforte73.fra.seabone.net 26.9%  1244 30.8  35.9  29.6 161.5  15.0
 9. 104.16.132.229                           26.4%  1244 34.2  31.3  30.4  46.0   1.5

I guess I’ll have to see if I can find a way to contact them, maybe they can assist.

I tried from Berlin and Frankfurt. It was about the same speed as without vpn. I also have an ubuntu VM in Frankfurt on DigitalOcean. It is fast too.

Since you have had this issue for weeks and you say it is probably not Docker specific, I would suspect something with your internet provider. Maybe a firewall or bad routing.

I have a similar issue coming from AS3320 DTAG and have extremely slow downloads from DockerHub. My AS path is DTAG (AS3320) <-> SEA-BONE (AS6762) <-> Cloudflare (AS13335) and it seems like the SEA-BONE network might be the issue in my case.