3

I have an MacBook Air (10.14.6) and the folder ~/Library/Containers/com.docker.docker/ contains 64 GB of data!!

How to clean up this folder?

Alex
  • 2,334
  • Are you sure it actually contains that much? Containers include aliases to other folders, and some disk management software can count the contents of the alias. You can of course just delete it all (after all, you have a backup). – benwiggy Jan 01 '22 at 10:19
  • I have a backup? – Alex Jan 01 '22 at 10:39
  • If you don't have a backup now, you will after a data loss... – Solar Mike Jan 01 '22 at 11:12
  • @Alex Files without a backup are waiting to be lost. This site is full of "how do I get my files back?" questions. – benwiggy Jan 01 '22 at 11:53
  • If I dont have Docker on my machine anymore, can I delete this folder? – C RICH Feb 25 '24 at 00:44

1 Answers1

2

I doubt the folder is 64 GB. That’s a very round number, the sort one might select as the disk size in Docker Desktop preferences.

Given 64 GB is set as the maximum size of the disk, Finder will show the size as this. Get Info and check the size on disk instead.

Docker Get Info in Finder showing size on disk

To get a breakdown and accurate sizes, run docker system df.

Docker can cope with files being deleted in this folder as long as it’s not running, but data will be lost. However the more standard way to free space is to docker system prune. See --help for usage.

For more information about how Docker Desktop stores data on disk, see https://docs.docker.com/desktop/mac/space/.

grg
  • 201,078
  • The size of the folder is indeed 64.01 GB. docker system df yields: TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 2 2 403.4MB 0B (0%) Containers 2 2 63B 0B (0%) Local Volumes 1 1 41.98MB 0B (0%) Build Cache 0 0 0B 0B – Alex Jan 01 '22 at 10:38
  • @Alex How are you determining the folder is 64 GB? That command hasn’t returned anywhere near 64 GB! – grg Jan 01 '22 at 10:39
  • Oh, it seems Finder has a bug. It shows the folder to have 64GB, but df -d 1 -m shows it to have less than 3GB. Looks like I cannot trust Finder... – Alex Jan 01 '22 at 10:41
  • @Alex It’s not a bug, as discussed above it’s the maximum size of the disk. Finder’s Get Info does report the ‘size on disk’ too which is accurate. – grg Jan 01 '22 at 10:42
  • So Finder does not tell me the used size within a folder? – Alex Jan 01 '22 at 10:43
  • @Alex As above, Get Info and check the size on disk. I’ve added a screenshot too now. – grg Jan 01 '22 at 10:57