Sign inSign up

binbashing/logrotate

By binbashing

Updated about 1 year ago

A simple docker container based on Alpine the does logrotate.

Image
0

10K+

binbashing/logrotate repository overview

Build and Push

Logrotate

A simple docker container based on Alpine the does logrotate.

Usage

  • Use shared volumes to share log files with a container that produces logfiles
  • Set LOGROTATE_PATTERN etc. to configure what logrotate watches, log file size, etc.
docker run -it --rm \
  --env CRON_SCHEDULE='' \
  --env LOGROTATE_SIZE=1M \
  --env LOGROTATE_PATTERN=/var/logs/example-app/*.log \
  -v logs:/var/logs/example-app
  binbashing/logrotate

Customization

Most options below are substituted into the config file for logrotate, so please refer to the Manpage for logrotate for detailled documentation.

OptionDefaultDescription
CRON_SCHEDULE0 * * * *Cron schedule for logrotate command
LOGROTATE_SIZE100MMaximum size of log files
LOGROTATE_MODEcopytruncateMode of log rotation
LOGROTATE_PATTERN/logs/*.logPath pattern of log files to manage
LOGROTATE_ROTATE0Number of old log files to keep

Tag summary

Content type

Image

Digest

sha256:676bb2432

Size

9.1 MB

Last updated

about 1 year ago

docker pull binbashing/logrotate