docker-composeでログローテとする方法
version: "3"
services:
app:
image: your-app-image
logging:
options:
max-size: "10k"
max-file: "5"
root@dinghy:~# ls -l /var/lib/docker/containers/1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e/
total 84
-r-------- 1 root root 6.5K Jul 19 14:38 1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e-json.log
-r-------- 1 root root 9.8K Jul 19 14:38 1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e-json.log.1
-r-------- 1 root root 9.9K Jul 19 14:38 1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e-json.log.2
-r-------- 1 root root 9.8K Jul 19 14:38 1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e-json.log.3
-r-------- 1 root root 9.8K Jul 19 14:38 1fe87eeef61e63244269bfd089501208f2772a615baefd0828e8fbe8cc6c964e-json.log.4