1.修改 Docker 配置以下配置会增加一段限制日志文件大小的参数cat > /etc/docker/daemon.json << EOF { "log-driver": "json-file", "log-opts": { "max-size": "20m", "max-file": "3" } } EOF2.重启 Docker 服务systemctl restart docker