From 492c93a03d9ca972721ce313987ab270c49fdad8 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Wed, 23 Nov 2022 19:47:32 +0800 Subject: [PATCH] update container image mirror site #1192 --- docs/guide/gitlab/gitlab-install.md | 2 +- ezdown | 4 ++-- roles/containerd/templates/config.toml.j2 | 12 ++++++++---- roles/docker/templates/daemon.json.j2 | 4 ++-- tools/imgutils | 11 ++++++----- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/guide/gitlab/gitlab-install.md b/docs/guide/gitlab/gitlab-install.md index 2a8461c..ed73584 100644 --- a/docs/guide/gitlab/gitlab-install.md +++ b/docs/guide/gitlab/gitlab-install.md @@ -1,4 +1,4 @@ -# 安装 gitlab +# 安装 gitlab [Deprecated] gitlab 是深受企业用户喜爱的基于 git 的代码管理系统。安装 gitlab 最理想的方式是利用 gitlab charts 部署到 k8s 集群上,但此方式还未成熟,期待后续推出更成熟稳定版本;本文使用 Docker 方式安装 gitlab: diff --git a/ezdown b/ezdown index 7cbc826..22c6c51 100755 --- a/ezdown +++ b/ezdown @@ -143,8 +143,8 @@ EOF { "exec-opts": ["native.cgroupdriver=$CGROUP_DRIVER"], "registry-mirrors": [ - "https://docker.mirrors.ustc.edu.cn", - "http://hub-mirror.c.163.com" + "https://docker.nju.edu.cn/", + "https://kuamavit.mirror.aliyuncs.com" ], "insecure-registries": ["http://easzlab.io.local:5000"], "max-concurrent-downloads": 10, diff --git a/roles/containerd/templates/config.toml.j2 b/roles/containerd/templates/config.toml.j2 index f7bcad5..bca426e 100644 --- a/roles/containerd/templates/config.toml.j2 +++ b/roles/containerd/templates/config.toml.j2 @@ -146,13 +146,17 @@ version = 2 endpoint = ["http://easzlab.io.local:5000"] {% if ENABLE_MIRROR_REGISTRY %} [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] - endpoint = ["https://docker.mirrors.ustc.edu.cn", "http://hub-mirror.c.163.com"] + endpoint = ["https://docker.nju.edu.cn/", "https://kuamavit.mirror.aliyuncs.com"] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."gcr.io"] - endpoint = ["https://gcr.mirrors.ustc.edu.cn"] + endpoint = ["https://gcr.nju.edu.cn"] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."k8s.gcr.io"] - endpoint = ["https://gcr.mirrors.ustc.edu.cn/google-containers/"] + endpoint = ["https://gcr.nju.edu.cn/google-containers/"] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."quay.io"] - endpoint = ["https://quay.mirrors.ustc.edu.cn"] + endpoint = ["https://quay.nju.edu.cn"] + [plugins."io.containerd.grpc.v1.cri".registry.mirrors."ghcr.io"] + endpoint = ["https://ghcr.nju.edu.cn"] + [plugins."io.containerd.grpc.v1.cri".registry.mirrors."nvcr.io"] + endpoint = ["https://ngc.nju.edu.cn"] {% endif %} [plugins."io.containerd.grpc.v1.cri".x509_key_pair_streaming] diff --git a/roles/docker/templates/daemon.json.j2 b/roles/docker/templates/daemon.json.j2 index 2087181..ea8c1d9 100644 --- a/roles/docker/templates/daemon.json.j2 +++ b/roles/docker/templates/daemon.json.j2 @@ -3,8 +3,8 @@ "exec-opts": ["native.cgroupdriver={{ CGROUP_DRIVER }}"], {% if ENABLE_MIRROR_REGISTRY %} "registry-mirrors": [ - "https://docker.mirrors.ustc.edu.cn", - "http://hub-mirror.c.163.com" + "https://docker.nju.edu.cn/", + "https://kuamavit.mirror.aliyuncs.com" ], {% endif %} {% if ENABLE_REMOTE_API %} diff --git a/tools/imgutils b/tools/imgutils index c3f829f..04793ee 100755 --- a/tools/imgutils +++ b/tools/imgutils @@ -1,5 +1,6 @@ #!/bin/bash #------------------------------------------------------------ +# !!! Deprecated Warning: this script may be out of date # - Save docker images to disk or load images from disk # - Pull docker images from 'gcr.io|k8s.gcr.io|quay.io' # @@ -90,7 +91,7 @@ function pull_any_image() { F=$(echo "$1"|awk -F/ '{print NF}') case "$F" in 1) - HUB="docker.mirrors.ustc.edu.cn" + HUB="docker.nju.edu.cn" GRP="library" IMG="$1" ;; @@ -98,11 +99,11 @@ function pull_any_image() { F1=$(echo "$1"|awk -F/ '{print $1}') F2=$(echo "$1"|awk -F/ '{print $2}') if [[ "$F1" == k8s.gcr.io ]];then - HUB="gcr.mirrors.ustc.edu.cn" + HUB="gcr.nju.edu.cn" GRP="google-containers" IMG="$F2" else - HUB="docker.mirrors.ustc.edu.cn" + HUB="docker.nju.edu.cn" GRP="$F1" IMG="$F2" fi @@ -112,9 +113,9 @@ function pull_any_image() { F2=$(echo "$1"|awk -F/ '{print $2}') F3=$(echo "$1"|awk -F/ '{print $3}') if [[ "$F1" == quay.io ]];then - HUB="quay.mirrors.ustc.edu.cn" + HUB="quay.nju.edu.cn" elif [[ "$F1" == gcr.io ]];then - HUB="gcr.mirrors.ustc.edu.cn" + HUB="gcr.nju.edu.cn" else logger warn "no mirror image for $1" HUB="$F1"