Skip to content

docker.raw file size vs diskusage report discrepancy #182

@woongCat

Description

@woongCat
Image

Description

I am using Docker Desktop on macOS.
The Docker data file (Docker.raw) is configured with a maximum size of 20GB.

When inspecting disk usage using different tools on the same directory path, I see a large discrepancy.

diskusage result

diskusage -D -u G ~/Library/Containers/com.docker.docker
  • Total reported usage: ~1024GB
  • The entire usage is attributed to the Data directory (100%)

du result on the same path

du -sh ~/Library/Containers/com.docker.docker/*
  • Data: ~30GB
  • Other files: negligible size

This indicates that both tools are inspecting the same directory, but reporting vastly different disk usage values.

Issue

While du reports a reasonable and expected disk usage (~30GB) for the Data directory,
diskusage reports it as occupying the maximum allocatable disk size (~1TB).

This makes it appear as if Docker is consuming almost the entire disk, even though the actual allocated space is much smaller.

Question

Is this behavior an expected consequence of how diskusage handles sparse files on macOS,
or is this a limitation or bug in how disk usage is calculated for directories containing sparse files such as Docker.raw?

  • If this is expected behavior, documenting this would help prevent confusion.
  • Otherwise, is there a recommended approach for reporting sparse file usage more accurately?

Environment

  • OS: macOS
  • Docker Desktop
  • diskusage (diskusage -D -u G)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions