
























因为过程中要频繁重启Docker,所以不要在正常跑容器的机器上面执行!!!
因为过程中要频繁重启Docker,所以不要在正常跑容器的机器上面执行!!!
因为过程中要频繁重启Docker,所以不要在正常跑容器的机器上面执行!!!
脚本代码:
1 #!/bin/bash 2 echo ' 3 https://cloudsx.top 4 https://docker.xuanyuan.me 5 https://docker.1ms.run 6 https://docker.hpcloud.cloud 7 https://docker.m.daocloud.io 8 https://docker.unsee.tech 9 https://docker.1panel.live 10 https://mirrors.ustc.edu.cn 11 https://docker.chenby.cn 12 https://mirror.azure.cn 13 https://dockerpull.org 14 https://dockerhub.icu 15 https://hub.rat.dev 16 https://proxy.1panel.live 17 https://docker.1panel.top 18 https://hub.geekery.cn 19 https://docker.rainbond.cc 20 https://docker.ketches.cn 21 https://docker.m.daocloud.io 22 https://docker.imgdb.de 23 https://docker-0.unsee.tech 24 https://docker.hlmirror.com 25 https://docker.1ms.run 26 https://func.ink 27 https://lispy.org 28 https://docker.xiaogenban1993.com 29 ' | while read URL 30 do 31 [ -z "$URL" ] && continue 32 START=$(date +%s) 33 echo '{"registry-mirrors": ["'${URL}'"]}' > /etc/docker/daemon.json 34 systemctl daemon-reload 35 systemctl reset-failed docker 36 systemctl restart docker 37 docker image prune -a -f &>/dev/null 38 docker pull nginx &>/dev/null || continue 39 END=$(date +%s) 40 echo -en "$((END - START))s\t$(docker image ls --no-trunc nginx:latest | grep nginx)\t$URL\n" 41 done
执行效果:
1 root@OPS:~/shells# bash docker-t.sh 2 6s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://cloudsx.top 3 1s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.1ms.run 4 1s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.m.daocloud.io 5 37s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.1panel.live 6 2s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://hub.rat.dev 7 2s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.m.daocloud.io 8 7s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker-0.unsee.tech 9 6s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.hlmirror.com 10 1s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://docker.1ms.run 11 6s nginx latest sha256:7150b3a39203cb5bee612ff4a9d18774f8c7caf6399d6e8985e97e28eb751c18 18 hours ago 240MB https://lispy.org
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。