ubuntu docker pull 失敗 Error response from daemon: Get https://registry-1.docker.io/v2/


問題:

ubuntu@VM-3-4-ubuntu:~$ docker pull tensorflow/tensorflow:2.3.4-gpu
Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

 

方案1  ---最后生效了,因為用的騰訊雲的服務器,之前添加的都沒用,直到添加了騰訊雲鏡像地址。。。

修改/etc/docker/daemon.json文件,並重啟docker服務

{

  "registry-mirrors": ["https://registry.docker-cn.com","http://hub-mirror.c.163.com","https://mirror.ccs.tencentyun.com"]

}

 

ubuntu@VM-3-4-ubuntu:/etc/docker$ docker info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.1-docker)
  scan: Docker Scan (Docker Inc., v0.17.0)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 20.10.14
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 3df54a852345ae127d1fa3092b95168e4a88e2f8
 runc version: v1.0.3-0-gf46b6ba
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-96-generic
 Operating System: Ubuntu 20.04 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 30.86GiB
 Name: VM-3-4-ubuntu
 ID: IDVL:ZVEF:S7BH:ABOT:DMVT:ME3D:5MOZ:VWUQ:2XOJ:SDM5:YMQE:HVSD
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://registry.docker-cn.com/
  http://hub-mirror.c.163.com/
  https://mirror.ccs.tencentyun.com/
 Live Restore Enabled: false

WARNING: No swap limit support

方案2 改后未生效,但操作過的

修改/etc/resolv.conf 文件 並重啟docker服務

添加內容:

nameserver 8.8.8.8
nameserver 8.8.4.4

 

以上方案均需要執行

ubuntu@VM-3-4-ubuntu:/etc/docker$ sudo systemctl daemon-reload
ubuntu@VM-3-4-ubuntu:/etc/docker$ sudo systemctl restart docker

鏡像拉取和服務器網絡狀態有關系

 

最終解決:::服務器網絡權限被收回,沒通知。。。。。。。o(╥﹏╥)o


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM