skip to Main Content

running df -h I get:

overlay          79G   70G  5.8G  93% /var/lib/docker/overlay2/a7bcb73019b20505a640593453aee3578647e027ccf90a607ad1806a9b25edd4/merged

Any idea how I can check why it takes so much space?

2

Answers


  1. An overlay filesystem, like a bind mount, doesn’t use any disk space itself. What’s reported is the disk space of the underlying filesystem. In this case, if you run df /var/lib/docker you’ll see the same disk space allocated to that underlying filesystem, and you can review what is used on that mount.

    If the issue is docker, then docker system prune would be a first step. If that doesn’t help and you see significant usage from the /var/lib/docker folder you want to clean, see this answer for additional suggestions.

    Login or Signup to reply.
  2. I come a bit late, but this question is a recurring one, and I think this is lacking a diagnose step.

    As @bmitch says, first check the size of /var/lib/docker.

    If docker is the problem, then run: docker system df. An example of output:

    TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
    Images          14        4         5.734GB   3.299GB (57%)
    Containers      4         4         2.203MB   0B (0%)
    Local Volumes   242       2         15.26GB   14.66GB (96%)
    Build Cache     425       0         64.32GB   64.32GB
    

    With that, you can cleary see what is taking space, and clean selectively.

    In some cases (mine), the build cache is the problem. You can safely delete it with docker builder prune. The usual options for prune can apply (--all, --filter).

    For images, volumes, use the classical prune commands.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search