1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| wget https://github.com/containerd/containerd/releases/download/v1.6.10/cri-containerd-1.6.10-linux-amd64.tar.gz tar -C / -xzf cri-containerd-1.6.10-linux-amd64.tar.gz echo $PATH containerd -v apt install libseccomp-dev -y runc -v
mkdir -p /etc/containerd mkdir /etc/containerd/certs.d/docker.io/ -p containerd config default > /etc/containerd/config.toml sed -i s/"SystemdCgroup = false"/"SystemdCgroup = true"/ /etc/containerd/config.toml sed -i s/'sandbox_image = "registry.k8s.io\/pause:3.6"'/'sandbox_image = "registry.aliyuncs.com\/k8sxio\/pause:3.8"'/ /etc/containerd/config.toml sed -i s/config_path.*/'config_path = "\/etc\/containerd\/certs.d"'/ /etc/containerd/config.toml # docker hub镜像加速 mkdir -p /etc/containerd/certs.d/docker.io cat > /etc/containerd/certs.d/docker.io/hosts.toml << EOF server = "https://docker.io" [host."https://hub.792588.xyz"] capabilities = ["pull", "resolve"] EOF
# registry.k8s.io镜像加速 mkdir -p /etc/containerd/certs.d/registry.k8s.io tee /etc/containerd/certs.d/registry.k8s.io/hosts.toml << 'EOF' server = "https://registry.k8s.io"
[host."https://k8s.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# docker.elastic.co镜像加速 mkdir -p /etc/containerd/certs.d/docker.elastic.co tee /etc/containerd/certs.d/docker.elastic.co/hosts.toml << 'EOF' server = "https://docker.elastic.co"
[host."https://elastic.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# gcr.io镜像加速 mkdir -p /etc/containerd/certs.d/gcr.io tee /etc/containerd/certs.d/gcr.io/hosts.toml << 'EOF' server = "https://gcr.io"
[host."https://gcr.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# ghcr.io镜像加速 mkdir -p /etc/containerd/certs.d/ghcr.io tee /etc/containerd/certs.d/ghcr.io/hosts.toml << 'EOF' server = "https://ghcr.io"
[host."https://ghcr.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# k8s.gcr.io镜像加速 mkdir -p /etc/containerd/certs.d/k8s.gcr.io tee /etc/containerd/certs.d/k8s.gcr.io/hosts.toml << 'EOF' server = "https://k8s.gcr.io"
[host."https://k8sgcr.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# mcr.m.daocloud.io镜像加速 mkdir -p /etc/containerd/certs.d/mcr.microsoft.com tee /etc/containerd/certs.d/mcr.microsoft.com/hosts.toml << 'EOF' server = "https://mcr.microsoft.com"
[host."https://mcr.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# nvcr.io镜像加速 mkdir -p /etc/containerd/certs.d/nvcr.io tee /etc/containerd/certs.d/nvcr.io/hosts.toml << 'EOF' server = "https://nvcr.io"
[host."https://nvcr.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF
# quay.io镜像加速 mkdir -p /etc/containerd/certs.d/quay.io tee /etc/containerd/certs.d/quay.io/hosts.toml << 'EOF' server = "https://quay.io"
[host."https://quay.792588.xyz"] capabilities = ["pull", "resolve", "push"] EOF systemctl enable containerd --now
|