清空

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"}
}

  

相关文章:

  • 2021-06-14
  • 2021-07-01
  • 2021-08-28
  • 2021-05-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-22
  • 2021-08-12
  • 2021-11-08
  • 2021-07-17
  • 2021-08-10
  • 2021-12-12
相关资源
相似解决方案