Docker容器日志采取我的所有磁盘空间 [英] Docker container logs taking all my disk space
问题描述
目前,我必须手动删除此文件,以避免磁盘已满。我读到在Docker 1.8中,将有一个参数旋转日志。
您将推荐什么作为当前的解决方法?
Docker 1.8已经发布了日志轮换选项。添加:
- log-opt max-size = 50m
当容器启动时,会发挥作用。您可以通过以下方式了解更多信息:
https://docs.docker.com/engine/admin/logging / overview /
I am running a container on a VM. My container is writing logs by default to /var/lib/docker/containers/CONTAINER_ID/CONTAINER_ID-json.log file until the disk is full.
Currently, I have to delete manually this file to avoid the disk to be full. I read that in Docker 1.8 there will be a parameter to rotate the logs. What would you recommend as the current workaround?
Docker 1.8 has been released with a log rotation option. Adding:
--log-opt max-size=50m
when the container is launched does the trick. You can learn more at: https://docs.docker.com/engine/admin/logging/overview/
这篇关于Docker容器日志采取我的所有磁盘空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!