Docker container logs taking all my disk space
CAUTION: This is for docker-compose version 2 only
Example:
version: '2'
services:
db:
container_name: db
image: mysql:5.7
ports:
- 3306:3306
logging:
options:
max-size: 50m
Docker 1.8 has been released with a log rotation option. Adding:
--log-opt max-size=50m
when the container is launched does the trick. You can learn more at: https://docs.docker.com/engine/admin/logging/overview/