> 技术文档 > 使用 docker build -t时遇到报错_error: failed to solve: python:3.10-slim: failed t

使用 docker build -t时遇到报错_error: failed to solve: python:3.10-slim: failed t

failed to solve: python:3.10: failed to resolve source metadata for docker.io/library/python:3.10: failed to do request: Head “https://registry-1.docker.io/v2/library/
python/manifests/3.10”: dialing registry-1.docker.io:443 container via direct connection because has no HTTPS proxy: connecting to registry-1.docker.io:443: dial tcp [2a03:2
880:f130:83:face:b00c:0:25de]:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

使用 docker build -t时遇到报错:

ERROR: failed to solve: python:3.10: failed to resolve source metadata for docker.io/library/python:3.10: failed to do request: Head “https://registry-1.docker.io/v2/library/
python/manifests/3.10”: dialing registry-1.docker.io:443 container via direct connection because has no HTTPS proxy: connecting to registry-1.docker.io:443: dial tcp [2a03:2
880:f130:83:face:b00c:0:25de]:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

在docker中更换镜像源就ok了

  1. 打开docker desktop
  2. 点击设置按钮
    使用 docker build -t时遇到报错_error: failed to solve: python:3.10-slim: failed t
  3. 点击docker engine,在下面添加
    “registry-mirrors”: [
    “https://docker.1panel.live”,
    “https://hub.rat.dev”
    ]

使用 docker build -t时遇到报错_error: failed to solve: python:3.10-slim: failed t