0


解决 Docker Hub 国内无法访问的方法(Docker 镜像下载加速)

docker配置
修改配置文件

vim /etc/docker/daemon.json

配置内容如下:

{"data-root":"/data/docker",
    "exec-opts":["native.cgroupdriver=systemd"],
    "registry-mirrors":["https://9cpn8tt6.mirror.aliyuncs.com",
    "https://dockerproxy.com",
    "https://hub-mirror.c.163.com",
    "https://mirror.baidubce.com",
    "https://ccr.ccs.tencentyun.com"]}

3.重启docker引擎

#重载unit配置文件
systemctl daemon-reload
systemctl restart docker
systemctl status docker

wget

https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.8/cri-dockerd-0.3.8-3.el7.x86_64.rpm

#安装
rpm -ivh cri-dockerd-0.3.8-3.el7.x86_64.rpm

修改/usr/lib/systemd/system/cri-docker.service中ExecStart那一行,制定用作Pod的基础容器镜像(pause)

ExecStart=/usr/bin/cri-dockerd --pod-infra-container-image=registry.k8s.io/pause:3.9 --container-runtime-endpoint fd://

vi /usr/lib/systemd/system/cri-docker.service

修改

--pod-infra-container-image=registry.k8s.io/pause:3.9 为
--pod-infra-container-image=registry.aliyuncs.com/google_containers/pause:3.9

重启cri-docker

systemctl daemon-reload
systemctl restart cri-docker

安装kubernetes
1 下载 kubelet kubeadm kubectl
在一台有网的机器执行:

# 配置镜像源# k8s源镜像源准备(社区版yum源,注意区分版本)cat<<EOF|tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/v1.30/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.30/rpm/repodata/repomd.xml.key
EOF
# yum下载(不安装)
yum -yinstall--downloadonly--downloaddir=/data/software/k8s-package kubeadm-1.30.0-150500.1.1 kubelet-1.30.0-150500.1.1 kubectl-1.30.0-150500.1.1

本文只贴核心


```bash
kubeadm init --kubernetes-version=v1.30.0 --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=192.168.0.20  --cri-socket unix:///var/run/cri-dockerd.sock --image-repository registry.aliyuncs.com/google_containers  --upload-certs

其他机子

kubeadm join192.168.0.20:6443 --token g4y5kb.zbx4xgqn4uzdwdlj \
        --discovery-token-ca-cert-hash sha256:742f87a0c870c0922afacdc3f30f5686d82a18380f8b8113f21be90341d24fa2  \
        --cri-socket unix:///var/run/cri-dockerd.sock
安装k8s 基础镜像使用阿里云的地址拉取

docker pull registry.aliyuncs.com/google_containers/kube-apiserver:v1.30.0
docker pull registry.aliyuncs.com/google_containers/kube-controller-manager:v1.30.0
docker pull registry.aliyuncs.com/google_containers/kube-scheduler:v1.30.0
docker pull registry.aliyuncs.com/google_containers/kube-proxy:v1.30.0
docker pull registry.aliyuncs.com/google_containers/coredns:1.11.1
docker pull registry.aliyuncs.com/google_containers/pause:3.9
docker pull registry.aliyuncs.com/google_containers/etcd:3.5.12-0

docker pull registry.aliyuncs.com/google_containers/calico/node:v3.27.3
docker pull registry.aliyuncs.com/google_containers/calico/kube-controllers:v3.27.3
docker pull registry.aliyuncs.com/google_containers/calico/cni:v3.27.3

获取kuboard
docker pull swr.cn-east-2.myhuaweicloud.com/kuboard/kuboard:v3

docker 安装[人大金仓](https://www.kingbase.com.cn/xzzx/index.htm)
docker run -d -it --privileged=true -p 54321:54321 -v /data/kingbase/license/:/opt --name kingbase -e DB_USER=system -e DB_PASSWORD=xxxx@2024 kingbase_v008r006c008b0014_single_x86:v1

安装kuboard v3
sudo docker run -d --restart=unless-stopped --name=kuboard -p 31000:80/tcp -p 10081:10081/tcp -e KUBOARD_ENDPOINT="http://172.16.17.203:31000" -e KUBOARD_AGENT_SERVER_TCP_PORT="10081" -v /root/kuboard-data:/data eipwork/kuboard:v3

安装redis
docker run --restart=always --sysctl net.core.somaxconn=1024 -p 6379:6379 --name redis -v /data/redis/redis.conf:/etc/redis/redis.conf -v /data/redis/log/:/var/log/redis/ -v /data/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes --requirepass  redis密码

安装pgsql
docker run -it --name postgres --restart always -e POSTGRES_PASSWORD='123456' -e ALLOW_IP_RANGE=0.0.0.0/0 -v /data/postgres/data:/var/lib/postgresql -p 5432:5432 -d postgres

安装dm8 镜像[官网下载](https://eco.dameng.com/download/)
docker run -d -p 5236:5236 --restart=always --name dm8 --privileged=true -e PAGE_SIZE=32 -e case_sensitive -e LD_LIBRARY_PATH=/data/dm8/dmdbms/bin -e EXTENT_SIZE=32 -e BLANK_PAD_MODE=1 -e LOG_SIZE=2048 -e UNICODE_FLAG=1 -e LENGTH_IN_CHAR=1 -e INSTANCE_NAME=dm8 -v /data/dm8/dm8:/opt/dmdbms/data dm8_single:dm8_20230808_rev197096_x86_rh6_64

本文转载自: https://blog.csdn.net/weimeilayer/article/details/139593384
版权归原作者 ❀͜͡傀儡师 所有, 如有侵权,请联系我们删除。

“解决 Docker Hub 国内无法访问的方法(Docker 镜像下载加速)”的评论:

还没有评论