Coding Agents & Terminal · recorded 2026-08-29 · applies to 1 tool(s) ✓ Verified

Problem: docker pull fails on campus/home network (connection reset / dead mirror lists) —— Trove problem library

Verified 2026-08-29docker pull connection reset — back up daemon.json, write a working registry-mirrors accelerator, restart docker.

Quick fix

# One-liner: back up the config + write currently measured working mirrors + restart docker
sudo cp /etc/docker/daemon.json /etc/docker/daemon.json.bak-$(date +%Y%m%d) && sudo tee /etc/docker/daemon.json >/dev/null <<'EOF'
{
  "registry-mirrors": [
    "https://docker.1panel.live",
    "https://docker.m.daocloud.io"
  ]
}
EOF
sudo service docker restart && docker pull hello-world

What you will run into

On campus/home networks (no proxy), docker pull reports ERROR: Get "https://registry-1.docker.io/v2/": ... connection reset by peer, or the image never downloads.

Following old tutorials about mirror accelerators makes it worse (no such host) — because most accelerator lists floating around the web are dead; don't copy them blindly.

Why this happens

The official Docker Hub registry (registry-1.docker.io) has no stable acceleration for CN networks; direct connections are frequently dropped at the network layer (connection reset / timeout are the same family).

Accelerators are third-party services that die and change: measured 2026-08-29, of 9 common accelerators only 1panel.live (200), daocloud (401), xuanyuan (401), 1ms (401), rat.dev (302) were usable;

dockerproxy.cn / sjtug / dockerpull.org / ustc were all dead (000) — "old lists from the web" and "outdated mirror configs" are the second biggest failure source (DNS no such host).

docker pull follows "CLI → registry-1.docker.io → CDN redirects for each layer blob": when domestic egress to the registry hostname is unstable, connections get reset/timed out at the transport layer — the error has nothing to do with your command.

A mirror accelerator is essentially a third-party registry proxy: its availability depends on its operator, and mirrors die, change domains, or get rate-limited — which is why "stale lists from tutorials + outdated mirror configs" are the second source of failure (DNS no such host).

Deterministic path: layer first — curl -I https://registry-1.docker.io/v2/ tells you about direct connectivity;

when probing accelerators, 401/302 does not mean dead (it may be a normal auth-required response), while 000 or DNS no such host means truly dead;

after configuring, you must confirm Registry Mirrors actually took effect via docker info — configuring without verifying is not configuring.

Step by step

1. Confirm the failure mode — Required

  • connection reset by peer / i/o timeout on the direct registry → connection dropped at network layer;
  • no such host / DNS resolution failure → the configured accelerator domain is dead.

2. Write in measured working mirrors — Required

sudo tee /etc/docker/daemon.json >/dev/null <<'EOF'
{
  "registry-mirrors": [
    "https://docker.1panel.live",
    "https://docker.m.daocloud.io"
  ]
}
EOF

Back up the original config first (the quick-fix command above already includes the backup).

Accelerators change; once the configured one stops working, run another measurement round (curl -o /dev/null -s -w '%{http_code}' https://<mirror-domain>/v2/; 401/200/302 = usable, 000 = dead).

3. Restart and verify — Required

sudo service docker restart
docker pull hello-world

Download complete / Pull complete means success (measured: after updating the config the pull succeeded, exit 0).

4. Errors during pull/extract (docker >= 23.0) — Required

Some mirror sites connect but fail during pull/extract; enable containerd native image storage: add "features": { "containerd-snapshotter": true } to daemon.json and restart (from a supplementary article;

this branch was not reproduced on this machine, not measured).

5. Long-term / enterprise options — Required

Self-host a registry, or pull through an HTTP proxy and import offline; CI can use an overseas build machine that can reach Hub.

How to confirm it works

docker pull hello-world && docker run --rm hello-world

A successful pull and run means it's fixed. Measured: direct registry-1.docker.io:443 curl timed out after 12s (Connection timed out, exit 28); after updating daemon.json (1panel.live + daocloud) docker pull hello-world succeeded.

Other environments

EnvironmentNotes
Docker Desktop (Windows)engine config lives in ~/.docker/daemon.json (same registry-mirrors field), or fill registry-mirrors in Docker Engine settings (no need to edit /etc/docker/daemon.json); apply with docker desktop stop and restart. 2026-08-30 verified 4 live mirrors (daocloud/1ms/1panel/xuanyuan) + hello-world pull OK
Campus/home network (no proxy)Direct connection always drops; use measured working mirrors
Corporate intranetMay have an internal registry; ask ops first; otherwise same as above
Behind VPN/proxyPull still fails through the proxy: the daemon does not read the shell's http_proxy — the proxy must be configured in a systemd drop-in or Docker Desktop's proxy settings; this branch was not reproduced locally (moby#48406, mechanism-based, complements the no-proxy direct-connect failure)
Old tutorial mirrorsdockerproxy.cn / sjtug / dockerpull.org / ustc are dead (measured 000), don't copy them

Symptom

docker pull fails in one of three common forms:

# Form 1: direct connection to Docker Hub reset (network layer)
Error response from daemon: Get "https://registry-1.docker.io/v2/": read tcp ...:443: read: connection reset by peer
# or: hangs after "Using default tag: latest" with no progress / timeout

# Form 2: configured mirror is dead (DNS layer)
Error response from daemon: failed to resolve reference "docker.io/library/xxx:latest":
failed to do request: Head "https://<mirror>/v2/...": dial tcp: lookup <mirror> on ...:53: no such host

Most common on networks inside China; the error may involve IPv6 addresses (IPv6 connection reset); retrying sometimes passes; worked before but suddenly fails one day (mirror shut down); or a fresh docker setup used a mirror list copied from an outdated tutorial.

Same family but different root cause (don't fight the network on this page):

  • manifest for xxx not found / manifest unknown -> image or tag does not exist, see docker-manifest-not-found;
  • no space left on device (pull/extract stage) -> under WSL the common truth is a full host drive, see wsl-no-space-left;
  • Pull stops halfway / repeated timeouts: network jitter — just re-run docker pull; already-downloaded layers are reused by digest and skipped automatically, no cache cleaning or rmi needed.

Cause

Docker Hub's official registry registry-1.docker.io is not directly reachable from networks inside China (connection reset / timeout). That is why "registry mirrors" became standard practice — but after Docker Hub tightened its policies in 2024, many public mirrors have shut down: the USTC mirror docker.mirrors.ustc.edu.cn, SJTU docker.mirrors.sjtug.sjtu.edu.cn, dockerproxy.cn, etc. were all dead in our 2026-08-29 test (DNS doesn't even resolve). Copying old mirror lists from the web is a top failure cause — mirrors have a lifespan; always test before configuring.

Solution

  1. Test first, then configure a working mirror (core): check with curl -s -o /dev/null -w "%{http_code}" --max-time 8 https://<mirror>/v2/ — 200/401/302 means reachable (401 is a normal unauthenticated registry response), 000 or DNS failure means dead. Verified working on 2026-08-29 (campus network): docker.1panel.live (200), docker.m.daocloud.io (401), docker.xuanyuan.run (401), docker.1ms.run (401), hub.rat.dev (302).
  2. Write daemon.json and restart: set registry-mirrors in /etc/docker/daemon.json (list several as fallbacks; docker tries them in order), then sudo systemctl restart docker (or sudo service docker restart). Example:
{
  "registry-mirrors": [
    "https://docker.1panel.live",
    "https://docker.m.daocloud.io"
  ]
}
  1. Verify with a real pull: docker pull hello-world succeeding means the fix is live.
  2. Pull/extraction-stage errors (docker >= 23.0): if the mirror is reachable but extraction fails, enable containerd's native image store: add "features": { "containerd-snapshotter": true } to daemon.json and restart (from a supplementary article; not reproduced here because pulls already succeed).
  3. Long-term / enterprise: run your own registry, or pull through an HTTP proxy and export offline; use a build machine outside the blocked network in CI.
Verification Evidence
  • Local repro (2026-08-29, campus network without proxy, Docker 29.1.3):
  • Direct registry-1.docker.io:443: curl Connection timed out after 12s (exit 28) — same family as the article's connection reset by peer (network-layer block);
  • The old mirror in the previous daemon.json (USTC): getent hosts → DNS no such host — reproducing Form 2's failure chain (outdated mirror config);
  • 9 candidate mirrors tested: 1panel.live=200, daocloud=401, xuanyuan=401, 1ms=401, rat.dev=302 alive; dockerproxy.cn / sjtug / dockerpull.org / ustc all 000 dead — proving old web lists cannot be trusted blindly;
  • Updated daemon.json (1panel.live + daocloud) → sudo service docker restart → docker pull hello-world succeeded (Download complete / Pull complete, exit 0);
  • Previous config backed up at /etc/docker/daemon.json.bak-20260829.

Evidence details kept locally (2026-08-29)

Related canonicals

Read in order: precondition -> this page -> same root / variant family:

Applicable tools (1)

This problem is linked from the tool pages below — reachable from either side.

docker

Source & evidence

Recorded Verified ✓ VerifiedApplies to 1 tool(s)
Entries contain locally measured or reviewable-source solutions; unmeasured items are explicitly labeled.

← Coding Agents & Terminal domain | Problem Catalog Experience | Facing another issue? Go to the Helpdesk