清空
cat /dev/null >json.log
docker-compose
nginx: image: nginx:1.12.1 restart: always logging: driver: “json-file” options: max-size: “5g”
全局设置
# vim /etc/docker/daemon.json{ "registry-mirrors": ["http://f613ce8f.m.daocloud.io"], "log-driver":"json-file", "log-opts": {"max-size":"500m", "max-file":"3"}}