Bug 1381727

Summary: docker fills /var/lib/docker/containers with logs - needs a logrotate config file
Product: OpenShift Container Platform Reporter: Dan Yocum <dyocum>
Component: ContainersAssignee: Jhon Honce <jhonce>
Status: CLOSED NOTABUG QA Contact: DeShuai Ma <dma>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: aos-bugs, jokerman, mmccomas, wmeng
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-04 20:51:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Dan Yocum 2016-10-04 20:22:52 UTC
Description of problem:

$subject says it all

Version-Release number of selected component (if applicable):

v3.2, at least

How reproducible:

always

Steps to Reproduce:
1. start your containers
2. watch /var/lib/docker/container/ dirs fill with logs w/o ever being rotated

Actual results:

/var fills up

Expected results:

/var doesn't fill up

Additional info:

An /etc/logrotate.d/docker config file should ship with docker.  Something like this:

/var/lib/docker/container/*/*-json.log {
    notifempty
    monthly
    rotate 5
    missingok
    compress
    copy-truncate
}

Comment 1 Dan Yocum 2016-10-04 20:51:17 UTC
Errr, um.  Apparently, there's an option to limit the log size in docker:

--log-opt max-size=XXm

So, with that in mind, I'm going to close it.