add mirror in aliyun
This commit is contained in:
@@ -69,7 +69,7 @@ fi
|
||||
# 配置镜像源的主机和路径
|
||||
declare -A mirrors
|
||||
mirrors=(
|
||||
["docker.io"]="https://docker.io https://docker.unsee.tech https://dockerhub.icu"
|
||||
["docker.io"]="https://docker.io https://docker.unsee.tech https://dockerhub.icu https://upnuemce.mirror.aliyuncs.com"
|
||||
["registry.k8s.io"]="https://registry.k8s.io https://k8s.m.daocloud.io"
|
||||
["docker.elastic.co"]="https://docker.elastic.co https://elastic.m.daocloud.io"
|
||||
["gcr.io"]="https://gcr.io https://gcr.m.daocloud.io"
|
||||
@@ -106,9 +106,19 @@ done
|
||||
nerdctl --namespace k8s.io image prune -a --force
|
||||
nerdctl --namespace default image prune -a --force
|
||||
|
||||
# 重启 containerd 服务
|
||||
echo "重启 containerd 服务..."
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user restart containerd
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart containerd
|
||||
|
||||
# 测试配置是否生效
|
||||
echo '测试配置是否生效...'
|
||||
if ctr --namespace=default image pull --hosts-dir "$CONFIG_PATH" docker.io/library/alpine:latest; then
|
||||
# nerdctl --namespace=default pull docker.io/bioconductor/cuda:devel
|
||||
# nerdctl --namespace=default pull docker.io/bioconductor/cuda:devel-R-devel
|
||||
# nerdctl --namespace=default --hosts-dir="$HOME/.config/containerd/certs.d" pull docker.io/ollama/ollama:latest
|
||||
if nerdctl --namespace=default --hosts-dir="$CONFIG_PATH" pull docker.io/library/alpine:latest; then
|
||||
echo "镜像加速配置成功!"
|
||||
else
|
||||
echo "镜像加速配置失败,请检查配置。"
|
||||
|
||||
Reference in New Issue
Block a user