3

I built an image based on ubuntu:16.04. While building the image I did run some commands including apt-get -y update.

Then, I browse the image by docker run -it myimage bash and I found there are some omitted files for logrotate in there comparing to normal ubuntu16.04 OS.

For instance, /etc/logrotate.conf, /usr/sbin/logrotate, /var/lib/logrotate/status.

I could't find them anywhere even with running find / -name logrotate*. the find command only show/etc/logrotate.d(/etc/cron.daily, /etc/cron.weekly also exist). Seeing trances of logrotate like logrotate.d, I assume logrotate must exist in there.

However, why it doesn't have not only those files but even also executable? I want them because I want to try it(How can I monitor what logrotate is doing)

How could I make it with the ubuntu16:04 image?

SangminKim
  • 8,358
  • 14
  • 69
  • 125

1 Answers1

1

Each container should have only one concern (I.e: no services, no daemons, no additional tools). Having that in mind, it make sense for logrotate configuration files to be omitted, since logrotate daemon is not there.

Alternatives to manage logs on containers could be using shared volumes (logrotate could then run on the host) (an example of that) or delegating to docker logging drivers.

Gonzalo Matheu
  • 8,984
  • 5
  • 35
  • 58