I mounted my containers' logs to the host (e.g. /var/log/container1
, etc). Now I want to use the host's logrotate
.
But suppose I need to do this:
create 660 mysql mysql
There is no mysql
user/group on the host, so logrotate fails with:
unknown user 'mysql'
So I tried:
create 660 999 999 # 999 is mysql user's uid/gid within container
But then I get:
unknown user '999'
So I tried:
create 660 999 999
su 999 999
But that gives the same error.
How can I do this, without creating a dummy user on the host?
(BTW, before you tell me to rely on docker's own log rotation... this is just an example. I use various containers which do not log to stdout/stderr so I need to do log rotation myself.)