System: long-running container that creates/delete files. Host is a RHEL7.2 (kernel 3.10.0-327.el7.x86_64) machine, with Docer v1.8.2 backed by a “loop-lvm” devicemapper pool.
Symptom: despite the container also deletes files, the available space in the devicemapper pool only shrinks and never increases.
Possible solution: run “fstrim /” from inside the container. Note that this requires you to run it in ‘privileged’ mode.
If you are using docker on Red-Hat based distributions, then devicemapper is your default filesystem for backing docker.
In case you want to change some of its default settings (i.e. if pool size of 100Gb is not enough), have a look at the “real docs” for RH7 or at this page for other distributions.
If you want to dig deeper, in this other page you will find a pretty detailed comparison of the different filesystems options available for RH.
In case you have a docker container on which you need a shell, and you don’t have it (e.g. it runs in the background, no sshd runs on it, …), you can have a shell on it by executing:
docker exec -it <container_name> /bin/bash