Docker 安装完成后配置镜像加速

  • 创建配置文件
1
2
3
4
5
6
7
8
9
10
11
12
13
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://docker.011025.xyz"],
"exec-opts": [
"native.cgroupdriver=systemd"
],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}
EOF
  • 重载System配置
1
systemctl daemon-reload
  • 重启docker服务
1
systemctl restart docker
  • 配置docker开机启动
1
systemctl enable docker