4

I have 5X Docker containers running in VM (mostly no volume attached)

After a while with no new containers deploy, I've notice Docker consume more disk space everyday

I've tried to remove log and/or unused image with

sudo sh -c "truncate -s 0 /var/lib/docker/containers/*/*-json.log"

docker system prune --volumes

It reclaim a very little disk space

Then, I've found 1 local volume that use 30ish GB (it was 29GB yesterday - growth rate ~1GB per day),

docker volume inspect <volume id>

[
    {
        "CreatedAt": "2022-06-28T12:00:15+07:00", << created last hour
        "Driver": "local",
        "Labels": null,
        "Mountpoint": "/var/lib/docker/volumes/4301ac15fed0bec1cd93aa181ab18c5227577c2532fff0a5f4e23956da1cfe4f/_data",
        "Name": "4301ac15fed0bec1cd93aa181ab18c5227577c2532fff0a5f4e23956da1cfe4f",
        "Options": null,
        "Scope": "local"
    }
]

And I don't even know what service/container use or create this volume.

How do I know that is it safe to remove this volume or how can I limit consumption of disk space ?

Jyme
  • 332
  • 2
  • 13
  • 2
    If you don't know which container is using that volume you should not just remove it. It might cause important data loss. If you have the mount-point you can check all running containers and determine which one uses it and then check why it is that huge. Check this link to determine it: https://stackoverflow.com/questions/42857575/how-to-determine-what-containers-use-the-docker-volume Info: If you have some memory leak, tests/pipelines with file manipulation or a jdownload/.. container then that can be the reason why it increases always. Often it is file population or download output. – LenglBoy Jun 28 '22 at 07:35

0 Answers0