By default, at least in Ubuntu, Docker container logs will grow indefinitely (in my case up to 412 GB, thus filling up my hard drive).
To prevent this, you can create a
/etc/docker/daemon.json file with the following configuration:
Don't forget to restart the Docker service afterwards, and in my case I had to do the following as well:
$ docker-compose down # this destroyed all my nice containers, but without it, they wouldn't accept the log config (maybe there's a better solution?)
$ docker-compose up -d
Finally, to check that the config was successful, for any of the containers that are running you can do this: (remember to replace the container ID)
Why would the default Docker configuration not have a log size limit‽ This makes zero sense to me.