1. docker镜像加速
docker镜像加速已失效,不知道未来某天会不会再次开放,日下镜像只能走梯子了,大家多保重。
"live-restore": true # 重启docker时不重启已启动的容器,布尔类型,不是字符串类型 "data-root": "/data1/docker/", # docker 数据目录 "log-driver":"json-file", # docker日志格式 json格式 "log-opts":{"max-size" :"50m","max-file":"1"}, # 日志最大50M,保留1个 "exec-opts": ["native.cgroupdriver=systemd"], # 启动方式、systemd方式
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"data-root": "/data1/docker/",
"log-driver": "json-file",
"log-opts":{
"max-size": "50m",
"max-file": "1"
},
"exec-opts": ["native.cgroupdriver=systemd"],
"live-restore": true,
"insecure-registries": ["xx.xx.x.x:xxxxx"],
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://dockerproxy.com",
"https://5oolx9ie.mirror.aliyuncs.com",
"https://dockerhub.azk8s.cn"
]
}
EOF
systemctl daemon-reload
systemctl restart docker
添加多个私有仓库
"insecure-registries": ["192.168.0.110",
"http://www.cnblogs.com:49999"],
参考链接:https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6
标签:systemd,json,file,镜像,docker,加速 From: https://www.cnblogs.com/2287keybord/p/18612567祝各位好运,天天发财