Home > database >  Disk space taken by Docker Bind Mount and how to delete it?
Disk space taken by Docker Bind Mount and how to delete it?

Time:10-19

After learning and using Docker with Bind Mount I have realized that a lot of extra space has been taken from my disk...

I have been able to remove all the volumes from the docker desktop (not much difference) but I have no idea where to find those Bind Mounts I have created, where to check the space taken by them and last, how to delete them.

I have run the command

TYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE
Images          0         0         0B        0B
Containers      0         0         0B        0B
Local Volumes   0         0         0B        0B
Build Cache     500       0         16.09GB   16.09GB

What is that Build Cache and how to deal with it?

I have checked also the Docker Engine config file:

{
  "builder": {
    "gc": {
      "defaultKeepStorage": "20GB",
      "enabled": true
    }
  },
  "experimental": false,
  "features": {
    "buildkit": true
  }
}

Do those 20GB reserved mean that it has been taken from my disk for Docker?

I deleted ALL my containers, images and volumes, so I only have that Cache.

CodePudding user response:

You could use docker builder prune -a command to remove all unused build cache. HERE you can find a nice script that periodically check space usage and run the cleaning.

  • Related