错误提示:

curl -I https://registry.docker.io
curl: (28) Failed to connect to registry.docker.io port 443: Connection timed out

curl -I https://registry.docker.io --proxy http://192.168.3.16:7890
HTTP/1.1 200 Connection established

HTTP/1.0 503 Service Unavailable
cache-control: no-cache
content-type: text/html

sudo vim /etc/systemd/system/docker.service.d/http-proxy.conf [Service]
Environment="HTTP_PROXY=http://192.168.3.16:7890"
Environment="HTTPS_PROXY=http://192.168.3.16:7890"
Environment="NO_PROXY=localhost,127.0.0.1,::1"

我配置两个地方 /etc/docker/damemon.json    {
  "data-root": "/home/powersys/work/docker",
  "registry-mirrors": [
    "https://registry.docker-cn.com",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://docker.mirrors.ustc.edu.cn"
  ]
} 我配置了docker的代理,所以

docker pull alpine:3.19
3.19: Pulling from library/alpine
1747dece9491: Pull complete 
Digest: sha256:3be987e6cde1d07e873c012bf6cfe941e6e85d16ca5fc5b8bedc675451d2de67
Status: Downloaded newer image for alpine:3.19
docker.io/library/alpine:3.19

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐