Skip to content

Instantly share code, notes, and snippets.

@rutcreate
Created May 18, 2018 09:07
Show Gist options
  • Save rutcreate/f83dbca893be44602317e3400504781c to your computer and use it in GitHub Desktop.
Save rutcreate/f83dbca893be44602317e3400504781c to your computer and use it in GitHub Desktop.
Logrotate for Docker containers
/var/lib/docker/containers/*/*.log {
rotate 7
daily
compress
size=1M
missingok
delaycompress
copytruncate
}
@rutcreate
Copy link
Author

rutcreate commented May 18, 2018

How to

  1. Copy docker-container file to /etc/logrotate.d/docker-container.
  2. Run command sudo logrotate -fv /etc/logrotate.d/docker-container to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment