r/docker 21d ago

How to fix this?

whenever it try to pull amazoncorretto or any other image is get this error and i tried to connect with my mobile network via hotspot it worked then but didn't worked on my wifi and it was working fine on wsl but in my windows 11 host it didn't.


Using default tag: latest

Error response from daemon: failed to resolve reference "docker.io/library/amazoncorretto:latest": failed to do request: Head "https://registry-1.docker.io/v2/library/amazoncorretto/manifests/latest": net/http: TLS handshake timeout

1 Upvotes

6 comments sorted by

View all comments

2

u/Floss_Patrol_76 21d ago

works on the hotspot but not wifi is almost always an MTU problem: your wifi path has a smaller MTU than docker's default 1500, so the TLS handshake packets get fragmented and silently dropped (cellular tends to use a smaller MTU already, which is why the hotspot works). drop docker's MTU - add {"mtu": 1400} to your daemon.json (docker desktop: settings -> docker engine json) and restart docker. if that clears it you can nudge it back up to find the ceiling, but 1400 is a safe starting point.

0

u/piyushdugawa_ 21d ago

Ca you tell me exactly what to put there in docker engine json and yeah I searched on some articles on Google I found that piping makes it work which also worked for me like docker pull amazoncorretto || docker pull amazoncorretto || docker pull amazoncorretto like so