I’m running a Garry’s Mod server under docker (code for the dockerfile/start script/etc can be found here). I have a bunch of data (addons, config files, etc) that I mount to the container using the -v
flag. The size of the folder that I mount is about 4.3 GB, and the project that I forked from said to expect around 10GB total when running the container, so I should be using somewhere around 14.3GB. However I noticed my disk usage was really high so I ran ncdu and saw that /var/lib/docker/overlay2
was 17GB.
Inside the overlay2
folder I see 2 large folders (all the folder names look like hashes, I’m assuming these are each tied to a container/image?). The first is 10.7GB, the second is 6.1GB. Inside the larger one I see a merged
folder and a diff
folder (8.4GB and 2.2GB respectively), both of which have a subfolder inside called gmodserv
. If I go back up and into the other container/image folder inside overlay2
, I see a 6.1GB diff
folder, also containing a gmodserv
folder. The gmodserv
folders are pretty much the entirety of the space inside their parent folders, so there’s nothing else that’s taking up this space.
If you look inside the Dockerfile, you’ll see that the gmodserv
folder is where the container stores all the content for the server, including the stuff that I mount. However, upon looking inside all these gmodserv
folders in overlay2
, none of them contain the data I’m mounting, instead they’re all just duplicates of the base server files (source engine, GMod textures, etc). I’m only running one instance of my container, so why is this gmodserv
folder showing up 3 times with pretty much the same files in all of them? It’s eating up my disk space to the point that it seems running the server outside of Docker would be better (but I would prefer to keep my Docker setup as it makes moving between machines simpler). Anyone know how to cut down these duplicated files? (and no, running docker system prune -a
does not get rid of them)