What is the default log rotation strategy used by Docker
for container logs.
How I can restrict the docker container log size to be max 1g
and rotate if the size goes bigger.
AFAIU,
Using docker run -
--log-opt max-size=1g
using compose -
logging:
options:
max-size: 1g
Also, you can set it globally by updating daemon config, generally /etc/docker/daemon.json
(Thanks @Stan for suggestion)
Ref - https://docs.docker.com/config/containers/logging/configure/#limitations-of-logging-drivers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With