docker国内镜像加速

r囧r小猫 2022-11-04 13:21 399阅读 0赞

1、阿里云容器 生成自己的加速地址

登陆地址:https://cr.console.aliyun.com/

选择自己的系统

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3hpeGluZ3poZTI_size_16_color_FFFFFF_t_70

2、修改配置文件

针对Docker客户端版本大于 1.10.0 的用户

您可以通过修改daemon配置文件/etc/docker/daemon.json来使用加速器

  1. >sudo mkdir -p /etc/docker
  2. >sudo tee /etc/docker/daemon.json <<-'EOF'
  3. {
  4. "registry-mirrors": ["https://dcjtn3xm.mirror.aliyuncs.com"]
  5. }
  6. EOF

3、加载重启docker

  1. >sudo systemctl daemon-reload
  2. >sudo systemctl restart docker

4、是否成功

  1. > docker info
  2. Client:
  3. Context: default
  4. Debug Mode: false
  5. Plugins:
  6. app: Docker App (Docker Inc., v0.9.1-beta3)
  7. buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)
  8. Server:
  9. Containers: 3
  10. Running: 0
  11. Paused: 0
  12. Stopped: 3
  13. Images: 4
  14. Server Version: 20.10.3
  15. Storage Driver: overlay2
  16. Backing Filesystem: extfs
  17. Supports d_type: true
  18. Native Overlay Diff: true
  19. Logging Driver: json-file
  20. Cgroup Driver: cgroupfs
  21. Cgroup Version: 1
  22. Plugins:
  23. Volume: local
  24. Network: bridge host ipvlan macvlan null overlay
  25. Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
  26. Swarm: inactive
  27. Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
  28. Default Runtime: runc
  29. Init Binary: docker-init
  30. containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
  31. runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
  32. init version: de40ad0
  33. Security Options:
  34. seccomp
  35. Profile: default
  36. Kernel Version: 3.10.0-1160.15.2.el7.x86_64
  37. Operating System: CentOS Linux 7 (Core)
  38. OSType: linux
  39. Architecture: x86_64
  40. CPUs: 4
  41. Total Memory: 15.25GiB
  42. Name: iZ2zeck0io750hybqc9ixiZ
  43. ID: ME2L:PFH4:GEMZ:NLE2:FZP7:6UJN:KHBK:I4QO:IPY3:OANB:I6O5:B3GV
  44. Docker Root Dir: /var/lib/docker
  45. Debug Mode: false
  46. Registry: https://index.docker.io/v1/
  47. Labels:
  48. Experimental: false
  49. Insecure Registries:
  50. 127.0.0.0/8
  51. Registry Mirrors:
  52. https://最新.mirror.aliyuncs.com/
  53. Live Restore Enabled: false

发表评论

表情:
评论列表 (有 0 条评论,399人围观)

还没有评论,来说两句吧...

相关阅读

    相关 docker镜像加速

    安装docker后,从docker hub下载镜像非常缓慢,经常执行好几次docker pull才能下载成功,可以选择国内镜像加速下载镜像,编辑/etc/docker/daem