- 修改daemon.json配置
vim /etc/docker/daemon.json
- 輸入i 替換為:
{ "builder": { "gc": { "defaultKeepStorage": "20GB", "enabled": true } }, "experimental": true, "features": { "buildkit": true }, "insecure-registries": [ "172.24.86.231" ], "registry-mirrors": [ "https://dockerproxy.com", "https://mirror.baidubce.com", "https://ccr.ccs.tencentyun.com", "https://docker.m.daocloud.io", "https://docker.nju.edu.cn", "https://docker.mirrors.ustc.edu.cn" ], "log-driver":"json-file", "log-opts": { "max-size":"500m", "max-file":"3" } }
- 輸入:wq儲存並退出,並重啟服務
sudo systemctl daemon-reload sudo systemctl restart docker
參考:https://blog.csdn.net/qq_44796920/article/details/139573309?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-0-139573309-blog-