Skip to content
RunStack
Wiki· Updated 19 Oct 2026

rs clean — Docker cleanup and log limits

What rs clean deletes and what not, how to limit Docker logs, rotation and journald.

rs clean shows what takes space and cleans step by step — each step asks. --report — report only, --yes — no questions, safe steps only.

What is deleted and what is not

StepDefaultRisk
Dangling images (untagged layers)yesnone: leftovers of old versions
Build cacheyesthe next docker build takes longer
Stopped containersnothey can no longer be started with docker start; RunStack containers are not touched
Unused imagesnodownloaded again when needed
Empty logs over 100 MBnolog history is lost; containers keep running
Log limit in daemon.jsonyes—
Shrink journald to 500 MBnoold system logs are lost

Volumes are never deleted — databases and app files live there. The script only lists unused ones; check and remove by hand: docker volume rm <name>.

Docker log limit

By default the json-file driver writes container logs without a limit — one chatty container can fill the disk. The limit for all new containers is in /etc/docker/daemon.json (rs clean adds it, keeping your other settings):

{
  "log-driver": "json-file",
  "log-opts": { "max-size": "10m", "max-file": "3" }
}

It applies after systemctl restart docker (running containers restart) and only to new or recreated containers: docker compose up -d --force-recreate in the project directory. For one service — in its compose file:

logging:
  driver: json-file
  options: { max-size: "10m", max-file: "5" }

RunStack services have this limit from the start.

The system journal

Limit journald permanently: SystemMaxUse=500M in /etc/systemd/journald.conf, then systemctl restart systemd-journald. Once: journalctl --vacuum-size=500M.

If the disk fills up again

  • rs info disk and du -xh / --max-depth=2 | sort -h | tail — what grows.
  • Backups on the same disk are a common cause; keep them elsewhere.
  • App logs in /var/log — check logrotate.