Interview Prep/Docker/Limits, logging, health checks and restarts

Configure log rotation globally.

BeginnerScenarioLimits, logging, health checks and restarts
Answer

Situation read → Default json-file logs grow unbounded.

What I'd do →

{
  "log-driver": "local",
  "log-opts": {"max-size": "20m", "max-file": "5"}
}

in /etc/docker/daemon.json; systemctl restart docker. Existing containers need recreation.

Why → The local driver compresses and rotates by default.

Interview tip → Changes apply only to new containers.

All Docker questions Roadmap: Docker & containers

More on Limits, logging, health checks and restarts