Skip to main content
PProfileMatch
← Path

Docker · Docker Compose and Production Habits: Healthchecks, Logs and Scanning

0 XP
  1. 1 current stop: learning
  2. 2 upcoming
  3. 3 upcoming
  4. 4 upcoming
  5. 5 upcoming

Finish after stop 5

Stop 1 of 5 · Garage: the logbook that never gets emptied

Trick to keep in mind+3 XP

Unbounded logs eat the disk: cap with size and file count so old pages get torn out.

Docker's default json-file logging driver keeps every line indefinitely, so a chatty service slowly consumes the host's disk. The fix lives in the logging options: set a maximum file size and a maximum number of files, and Docker rotates and discards the oldest. Restart policies and healthchecks answer different questions.

Read it once, then a question tests whether the trick stuck.