Docker Community Forums

Share and learn in the Docker community.

First condifuratione and log size

Hello all,
this is my first post so hope you will be lenient with me :slight_smile:

I’ve just intalled my istance of docker on a RBP4.
I would like to setup a logs size limit and rotation for all my containers in the same way.
Actually I’ve wrote the following /etc/docker/daemon.json as follows:

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3",
    "labels": "production_status",
    "env": "os,customer"
  }
}

then I’ve restarted the demon but… if I chek

/var/lib/docker/containers# ls -lahR |grep json.log
-rw-r-----  1 root root  12K feb 23 11:42 0cb8355542d3c10f5ebf1ea555905dfcfef72b290229f44668bc2572f2cb1ba0-json.log
-rw-r-----  1 root root  42M feb 23 11:37 0e47ab1f3c12c1a073427084fd24bb0fcbb2b14d88ea6ccc2f860fe7e046757f-json.log
-rw-r-----  1 root root 367K feb 23 11:42 6e45c89ef5984457351477718ae28152a4373545b06cdd7ee43832f0978f42a6-json.log
-rw-r-----  1 root root 2,3K feb  3 17:01 a44b24c1bbe333527ec1613f1f688b2e73b3a71cebf5c3d3ba38fcadde8a940e-json.log
-rw-r-----  1 root root 1,7M feb 23 11:02 c11d758aeee2ff865abbcbeca7ddacdb4a7f284425ce33bcec4babc4bc0dc7b4-json.log
-rw-r-----  1 root root 152K feb 23 11:02 c58c73bbf3a5e6f71f741809e4f1ebed87fc2cdfcd31bfd06606bd671fcee327-json.log
-rw-r-----  1 root root  15K feb 23 11:02 cf2fbb37148121bb51d3cffdf3ccda562d4572223dc2ec8801891c1231075c07-json.log
-rw-r-----  1 root root 1,4M feb 23 11:42 e38a96675249a0ffd266c568b43c6fc0d3bf2dc7d5123f8d21c703de95690ca4-json.log
-rw-r-----  1 root root  39K feb 23 10:09 e3de3a73840ca0e4a3869c0256339114d531f0965eb7de9347f0f39f84506613-json.log

As you can see, I have files bigger the 10 Mb as espected. What do I wrong?

One more question is, may I set some kind of day-rotation parameter?

Thank you all