Dannii noticed that their Discourse installation at /var/discourse (20GB) and Docker’s /var/lib/docker (21GB) were nearly identical in size, raising concerns about potential data duplication. They suspected Docker might be unnecessarily copying data, especially since much of the Docker folder was in “overlays.” pfaffman suggested running ./launcher cleanup, noting that leftover Docker containers could be the cause — implying yes, duplication might be occurring. Dannii had previously tried docker container prune (no effect) and docker image prune (freed 1.5GB), but hadn’t considered the launcher’s cleanup tool. After running launcher cleanup, Dannii freed 6.6GB by removing unused Docker images (which docker image prune missed) and additionally deleted a 3.4GB PostgreSQL backup data cluster — resolving the immediate space issue. The cleanup suggests Docker wasn’t duplicating live data per se, but was retaining old images and backup artifacts that inflated disk usage. This highlights that Docker’s layering and image management can lead to apparent redundancy if not regularly cleaned, even if no active duplication is occurring.
My forum is hitting the limits of its server’s file system, but before upgrading the server I wanted to check there isn’t any config that would make it use the FS more efficiently.
I have a standard install in /var/discourse, which is 20GB. But the /var/lib/docker folder is 21GB, most of which seems to be in “overlays” for the FS.
I don’t understand how Docker works at the FS level, and I assume it’s not just carelessly duplicating data, but the two folders being so similar in size does make me wonder if there’s a chance the /var/discourse data has been copied into the Docker folder.
I did run docker container prune, which didn’t do anything. The container list only shows the main app and the mail receiver. I also ran docker image prune which freed 1.5GB space.
I didn’t think of running the launcher’s cleanup. Will try and report back.
launcher cleanup cleaned up 6.6GB of images (I’m not sure why docker image prune didn’t remove them!), and also removed a 3.4GB Postgresql ‘backup data cluster’. So that will give us enough space for a while.