https://blog.csdn.net/chaochao2113/article/details/120675757

sudo mkdir -p /etc/docker
sudo vim /etc/docker/daemon.json
{
    "data-root": "/dataA/docker",
    "exec-opts": ["native.cgroupdriver=systemd"],
    "log-driver":"json-file",
    "log-opts": {"max-size":"10m", "max-file":"5"},
    "bip": "172.19.0.1/24", #网关地址
    #"fixed-cidr": "192.168.1.0/25",  #
    #"fixed-cidr-v6": "2001:db8::/64",  #
    #"default-gateway": "192.168.1.254",
    #"default-gateway-v6": "2001:db8:abcd::89",
    "default-address-pools": [ #可用地址池
        {"base": "10.10.0.0/16", "size": 24},
        {"base": "10.20.0.0/16", "size": 24},
        {"base": "10.30.0.0/16", "size": 24},
        {"base": "10.40.0.0/16", "size": 24}
      ]    ,
     "registry-mirrors": [
     "https://bhtknto5.mirror.aliyuncs.com",
     "https://yo3sdl2l.mirror.aliyuncs.com",
     "https://blkjc4x3.mirror.aliyuncs.com",
     ],
     "insecure-registries":["101.1.11.111:5000"] #私用仓库
}

sudo systemctl daemon-reload
sudo systemctl restart docker
#cgroupdriver的驱动另一种方式
native.cgroupdriver=cgroupfs

清华大学

vi /etc/docker/daemon.json
sudo cat <<EOL >/etc/docker/daemon.json
{
    "registry-mirrors": [
          "https://docker.mirrors.ustc.edu.cn"
        ],
    "log-driver":"json-file",
    "log-opts": {"max-size":"5m", "max-file":"5"}
}
EOL

修改存储位置

systemctl stop docker
cp -R -p /var/lib/docker/* /nasB/docker
vi /etc/docker/daemon.json
{
"data-root": "/nasB/docker",
}

#centos7.9
vi /usr/lib/systemd/system/docker.service
在 docker 启动时候 加载参数 --storage-opt dm.basesize=100G 用来调整默认容器的 rootfs大小;
在创建容器的时候使用参数--storage-opt size=30G来设置改容器的 rootfs 大小

腾讯云

https://cloud.tencent.com/developer/article/1764607?from=15425
{
   "log-driver":"json-file",
    "log-opts": {"max-size":"5m", "max-file":"5"},
   "registry-mirrors": [
       "https://mirror.ccs.tencentyun.com"
  ]
}
systemctl daemon-reload
service docker restart
docker info #查看更换结果

registry-mirrors

https://www.daocloud.io/

腾讯
https://mirror.ccs.tencentyun.com
#中科大
https://docker.mirrors.ustc.edu.cn/